<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>int128</author_name>
  <author_url>https://blog.hatena.ne.jp/int128/</author_url>
  <blog_title>GeekFactory</blog_title>
  <blog_url>https://int128.hatenablog.com/</blog_url>
  <categories>
    <anon>swagger</anon>
  </categories>
  <description>Swagger（OpenAPI）では必須チェック（required: true）や数値型チェック（type: integer）などが用意されており、コード生成時にバリデーションコードを出力できます。しかし、複雑なバリデーションルールを定義するには正規表現に頼らざるを得ないため、YAMLの保守性が悪化する問題を抱えています。そこで本稿では、Bean Validation Annotationのようなカスタムバリデータを用意し、コード生成時に適切なアノテーションを出力する方法を提案します。 Swaggerでは x- で始まる属性はVendor Extensionsと呼ばれており、APIやモデルを自…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fint128.hatenablog.com%2Fentry%2F2017%2F08%2F14%2F014253&quot; title=&quot;Swagger Codegenにおけるカスタムバリデーションの追加 - GeekFactory&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-08-14 01:42:53</published>
  <title>Swagger Codegenにおけるカスタムバリデーションの追加</title>
  <type>rich</type>
  <url>https://int128.hatenablog.com/entry/2017/08/14/014253</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
