Skip to content

livingobjects/myrddin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

myrddin

Build Status

Swagger yaml (v2.0 format) file parser in Java.

This library allow you to read API REST documentation written in Swagger YAML format (spec 2.0).

Not all specification is implemented yet.

The library is an OSGI bundle which depends on snakeyaml and guava.

Format

See the following examples to see supported format : https://github.com/livingobjects/myrddin/tree/develop/src/test/resources

Example

The supported Json schema types are:

Base for all schema:

schema:
  type | $ref | oneOf | allOf
  title: XXX
  description: XXX

Basic json types

array

schema:
  type: array
  items:
    <schema>

object

schema:
  type: object
  properties:
    <property_name>:
      <schema>
  required:
    - <required_prop_name>

number, integer

schema:
  type: number
  format: <format_as_string> (ex: "int32", "double")
  multipleOf: <integer>
  minimum: <integer>
  maximum: <integer>
  exclusiveMinimum: <boolean>
  exclusiveMaximum: <boolean>

string

schema:
  type: string
  format: <format_as_string> (ex: "email")
  pattern: <regexp_pattern_as_string>
  minLength: <integer>
  maxLength: <integer>

boolean

schema:
  type: boolean

Reference a defined type:

schema:
  $ref: <the_reference_model_as_string> (Ex: '#/definitions/TypeName')

Type combinaisons:

anyOf, oneOf

schema:
  anyOf:
    - subtype1
    - subtype2
schema:
  oneOf:
    - subtype1
    - subtype2

About

Swagger yaml format parser in Java

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors