Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix to valid openapi3 format #40

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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