Skip to content

Commit

Permalink
fix: fix to valid openapi3 format (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
asafMasa authored Feb 18, 2021
1 parent 8f4a1d9 commit 7ae678f
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 200 deletions.
257 changes: 135 additions & 122 deletions src/yaml/geojson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,133 +2,146 @@ openapi: "3.0.1"
info:
title: Geojson definitions
version: 1.0.0
definitions:
Geometry:
type: object
description: GeoJSon geometry
discriminator: type
required:
- type
externalDocs:
url: http://geojson.org/geojson-spec.html#geometry-objects
properties:
type:
type: string
enum:
- Point
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
description: the geometry type

Point2D:
type: array
maxItems: 2
minItems: 2
items:
type: number

Point:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id2
allOf:
- $ref: "#/definitions/Geometry"
- properties:
coordinates:
$ref: "#/definitions/Point2D"

LineString:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id3
allOf:
- $ref: "#/definitions/Geometry"
- properties:
coordinates:
type: array
items:
$ref: "#/definitions/Point2D"

Polygon:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id4
allOf:
- $ref: "#/definitions/Geometry"
- properties:
coordinates:
type: array
items:
components:
schemas:
GeometryBase:
type: object
description: GeoJSon geometry
required:
- type
externalDocs:
url: http://geojson.org/geojson-spec.html#geometry-objects
properties:
type:
type: string
enum:
- Point
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
description: the geometry type

Geometry:
description: GeoJSon geometry
discriminator:
propertyName: type
type: object
oneOf:
- $ref: '#/components/schemas/Point'
- $ref: '#/components/schemas/LineString'
- $ref: '#/components/schemas/Polygon'
- $ref: '#/components/schemas/MultiPoint'
- $ref: '#/components/schemas/MultiLineString'
- $ref: '#/components/schemas/MultiPolygon'

Point2D:
type: array
maxItems: 2
minItems: 2
items:
type: number

Point:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id2
allOf:
- $ref: "#/components/schemas/GeometryBase"
- properties:
coordinates:
$ref: "#/components/schemas/Point2D"

LineString:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id3
allOf:
- $ref: "#/components/schemas/GeometryBase"
- properties:
coordinates:
type: array
items:
$ref: "#/definitions/Point2D"

MultiPoint:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id5
allOf:
- $ref: "#/definitions/Geometry"
- properties:
coordinates:
type: array
items:
$ref: "#/definitions/Point2D"

MultiLineString:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id6
allOf:
- $ref: "#/definitions/Geometry"
- properties:
coordinates:
type: array
items:
$ref: "#/components/schemas/Point2D"

Polygon:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id4
allOf:
- $ref: "#/components/schemas/GeometryBase"
- properties:
coordinates:
type: array
items:
$ref: "#/definitions/Point2D"

MultiPolygon:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id6
allOf:
- $ref: "#/definitions/Geometry"
- properties:
coordinates:
type: array
items:
type: array
items:
$ref: "#/components/schemas/Point2D"

MultiPoint:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id5
allOf:
- $ref: "#/components/schemas/GeometryBase"
- properties:
coordinates:
type: array
items:
$ref: "#/components/schemas/Point2D"

MultiLineString:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id6
allOf:
- $ref: "#/components/schemas/GeometryBase"
- properties:
coordinates:
type: array
items:
type: array
items:
$ref: "#/components/schemas/Point2D"

MultiPolygon:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id6
allOf:
- $ref: "#/components/schemas/GeometryBase"
- properties:
coordinates:
type: array
items:
type: array
items:
$ref: "#/definitions/Point2D"

GeometryCollection:
type: object
description: GeoJSon geometry collection
required:
- type
- geometries
externalDocs:
url: http://geojson.org/geojson-spec.html#geometrycollection
properties:
type:
type: string
enum:
- GeometryCollection
description:
geometries:
type: array
items:
$ref: "#/definitions/Geometry"
type: array
items:
$ref: "#/components/schemas/Point2D"

GeometryCollection:
type: object
description: GeoJSon geometry collection
required:
- type
- geometries
externalDocs:
url: http://geojson.org/geojson-spec.html#geometrycollection
properties:
type:
type: string
enum:
- GeometryCollection
description: custom properties
geometries:
type: array
items:
$ref: "#/components/schemas/GeometryBase"
Loading

0 comments on commit 7ae678f

Please sign in to comment.