flatten data structure on product

flatten data structure on product


Update api.raml

Update api.raml

#%RAML 0.8
---
title: Pickup Point API
baseUri: https://api.bring.com/pickuppoint/api/pickuppoint

documentation:

        The Pickup Point API becomes authenticated from 01.11.2020

            Our customers are increasingly demanding new functionality and solutions that are easy to use. To meet these expectations, we must know which customers and partners are using our APIs and how they are using them.

            To further develop the value proposition of our Pickup Point API, the solution becomes authenticated from 01.11.2020.

            We recommend making the adjustment already now, well in advance of summer vacations and peak season.

    {% include apiflock.html %}

- title: Introduction
  content: |
      The Pickup point API provides a list of locations for package pickup. Based on a specified postal code or a geographical location, the 10 nearest pickup points are returned, sorted by driving time by car(source: Google). In instances where google is unable to retrieve driving times from a location to a pickup point(e.g. location on mainland and pickup point on an island), these pickup points will be sorted by aerial distance and placed last in the list. Response is available as either XML or JSON.

      A pickup point is defined as any location delivering shipments on behalf of Bring and Posten, such as post offices, selected grocery stores, lockers, etc.

      It is important to note, there are two sets of addresses in the response, postbox(address, postalCode) and visiting address(visitingAddress,visitingPostalCode).Postbox address is required to get a package produced correctly, use this AS RECIPIENT address on label. Visiting address is more appropriate for user interface (Street address of the PIB).

      ### Filtering results

      In addition to postal code or location, one or more optional parameters can be added to the request, adding additional restrictions to the pickup points being returned. One such parameter is `searchForText=<texts>`, resulting in a response where all pickup points have at least a partial match with the search string given in `<texts>`. This can be the name of the pickup point, its address, city, county, municipality or location. Go to the reference table or see additional examples for more information.

      ### Rate limiting

      The Pickup point API has a rate limit, primarily considered on a per-user basis. Currently it limits API users to no more than 60 requests within a minute from a single IP address.

      Once you go over the rate limit, you will receive a response with an HTTP response code of 429 (Too Many Requests). The body of the response will consist of the following fields:

      - `code`: `429`
      - `error_message`: `The maximum number of requests per minute has been exceeded.`

      As an additional note, While accessing the Pickup point API together with Shipping Guide API, the service list should be displayed even in the case that the request has been rate limited by the Pickup point API.

      #### High-volume users

      If you're a high-volume user of the Pickup Point API, please [contact us](mailto:developer@bring.com) to discuss your options.

      When contacting Bring support include a description of how you are using the Pickup Point API, also an estimate of current request volumes.

      #### Distinct PickupPointType

      Norway :
        - Type 4  : Post i Butikk
        - Type 19 : Posten pakkeutlevering
        - Type 21 : Postkontor
        - Type 27 : Pakkeautomat
        - Type 32 : Postpunkt, egendrevet
        - Type 33 : Postpunkt
        - Type 37 : Pakkeboks

      Sweden :
        - Type 28 : Manned
        - Type 29 : Locker

      Denmark :
        - Type 85 : Manned
        - Type 86 : Locker

      Finland :
        - Type SmartPOST  : Finland Smart Post Pickup
        - Type Posti      : Finland Posti Pickup Point
        - Type Noutopiste : Finland Pickup Point
        - Type LOCKER     : Finland Locker Pickup Point

- title: Steps for Authentication
  content: |

      Before you can begin using the pickuppoint API you'll have to do the following:
         * [Sign up for a Mybring account](https://www.mybring.com/signup/register/user) if you do not already have one. If you're already registered in Mybring, head to the [settings and API](https://www.mybring.com/useradmin/account/settings/api) page to get your API key.
         * [Generate an API key](/api/#authentication) for your user

      ### 1. Get your API key from Mybring
      To make API requests you will need an API key. Click the link below, which sends you to your "Settings and API" page in Mybring profile administration. Scroll down to the "API key" section. Your generated API key which you will use to authenticate your requests can be found here.

      Get API key

      ### 2. Add authentication headers
      A description of the headers can be found in [Getting Started / Authentication](/api/#authentication).

/{countryCode}/postalCode/{postalCode}{mediaTypeExtension}:
  displayName: Pickup points for postal code
  uriParameters:
    countryCode:
      displayName: Country
      enum: [ "NO", "DK", "SE", "FI" ]
    postalCode:
      displayName: Postal code
      type: string
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json, .xml to get application/xml or .html to get HTML.
  get:
    description: List pickup points for postal code
    queryParameters:
      searchForText:
        displayName: Text filter
        type: string
      openingHoursSearchType:
        displayName: Filter using opening hours
        enum: [ ALL_WEEKDAYS, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY ]
      openOnOrBefore:
        description: Format `HHmm`. Return only pickup points that are open on or before the specified time.
        type: string
        pattern: ^([01][0-9]|2[0-3])[0-5][0-9]$
      openOnOrAfter:
        description: Format `HHmm`. Return only pickup points that are open on or after the specified time.
        type: string
        pattern: ^([01][0-9]|2[0-3])[0-5][0-9]$
      pickupPointType:
        displayName: Pickup-point type
        description: Currently available for Swedish, Finnish and Danish pickup point request only.
        enum: [ manned, locker ]
      numberOfResponses:
        description: Return the specified number of pickup points instead of the default. Try this param to get more pickup points, if a desired pickup point is missing in the response.
        type: integer
        default: 10
      street:
        description: Searches for the nearest pickup points to the given street. Use this param to get more accurate result.
        type: string
      streetNumber:
        description: Searches for the nearest pickup points to the given street number.Use this param to get more accurate result.
        type: string
      callback:
        description: JSONP callback function name.
        type: string
      requestCountryCode:
        description: Country code of the requester. Only applicable for Norwegian pickup points.
        type: string
    responses:
      200:
        displayName: Example response for NO/postalCode/1407
        body:
          application/json:
            example: !include examples/by_postal_code.json
          application/xml:
            example: !include examples/by_postal_code.xml
      250:
        displayName: Using postal code and street address
        description: |
          Sometimes (especially in Denmark) it's a good idea to also specify the address when searching for pickup points, to get more accurate results.

          In [this example](https://api.bring.com/pickuppoint/api/pickuppoint/DK/postalCode/2000.json?street=Smallegade&streetNumber=3), we look for pickup points in Smallegade 3, 2000 Frederiksberg.
        body:
          application/json:
            example: !include examples/filter_address.json
          application/xml:
            example: !include examples/filter_address.xml
      251:
        displayName: Find pickup points containing a specific string
        description: |
          If you want to return only the pickup points matching a specific string, you may use the `searchForText` query param. The given text can be the name of the pickup point, its address, city, county, municipality or location. Partial matches are also allowed.

          In [this example](https://api.bring.com/pickuppoint/api/pickuppoint/NO/postalCode/1407.json?searchForText=KIWI), we look for pickup points near NO/1407 cotaining "Kiwi".
        body:
          application/json:
            example: !include examples/filter_search.json
          application/xml:
            example: !include examples/filter_search.xml
      252:
        displayName: Find pickup points open on specific days
        description: |
          If you want to return only the pickup points open on specified days, you may use the `openingHoursSearchType=<day>` query param. `<day>` be:

          - `ALL_WEEKDAYS` (default)
          - `MONDAY`
          - `TUESDAY`
          - `WEDNESDAY`
          - `THURSDAY`
          - `FRIDAY`
          - `SATURDAY`
          - `SUNDAY`

          If you want you can also add `openOnOrBefore` and / or `openOnOrAfter`, to limit the search even more.

          In [this example](https://api.bring.com/pickuppoint/api/pickuppoint/NO/postalCode/1407.json?openingHoursSearchType=SUNDAY), we look for pickup points near NO/1407 that are open Sundays.
        body:
          application/json:
            example: !include examples/filter_days.json
          application/xml:
            example: !include examples/filter_days.xml
      253:
        displayName: Find pickup points open at specific hours
        description: |
          If you want to return only the pickup points open on specific hours, you may use the `openOnOrBefore=<time>` and/or `openOnOrAfter=<time>` query params.

          The format of `<time>` is `HHmm`.

          In [this example](https://api.bring.com/pickuppoint/api/pickuppoint/NO/postalCode/1407.json?openOnOrBefore=0800), we look for pickup points near NO/1407 open on or before 08:00.
        body:
          application/json:
            example: !include examples/filter_hours.json
          application/xml:
            example: !include examples/filter_hours.xml

/{countryCode}/location/{latitude},{longitude}{mediaTypeExtension}:
  displayName: Pickup points for location
  uriParameters:
    countryCode:
      displayName: Country
      enum: [ "NO", "DK", "SE", "FI" ]
    latitude:
      displayName: Latitude
      description: Geographic coordinate specifying the north-south position.
      type: string
    longitude:
      displayName: Longitude
      description: Geographic coordinate specifying the east-west position.
      type: string
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: List pickup points closest to location
    queryParameters:
      searchForText:
        displayName: Text filter
        type: string
      openingHoursSearchType:
        displayName: Filter using opening hours
        enum: [ ALL_WEEKDAYS, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY ]
      openOnOrBefore:
        description: Format `HHmm`. Return only pickup points that are open on or before the specified time.
        type: string
        pattern: ^([01][0-9]|2[0-3])[0-5][0-9]$
      openOnOrAfter:
        description: Format `HHmm`. Return only pickup points that are open on or after the specified time.
        type: string
        pattern: ^([01][0-9]|2[0-3])[0-5][0-9]$
      pickupPointType:
        displayName: Pickup-point type
        description: Currently available for Swedish, Finnish and Danish pickup point request only.
        enum: [ manned, locker ]
      numberOfResponses:
        description: Return the specified number of pickup points instead of the default.
        type: integer
        default: 10
      street:
        description: Searches for the nearest pickup points to the given street.
        type: string
      streetNumber:
        description: Searches for the nearest pickup points to the given street number.
        type: string
      callback:
        description: JSONP callback function name.
        type: string
      requestCountryCode:
        description: Country code of the requester. Only applicable for Norwegian pickup points.
        type: string
    responses:
      200:
        displayName: Example response for location/60.395226,5.321725
        body:
          application/json:
            example: !include examples/by_coordinates.json
          application/xml:
            example: !include examples/by_coordinates.xml

/{countryCode}/id/{id}{mediaTypeExtension}:
  displayName: A specific pickup point
  uriParameters:
    countryCode:
      displayName: Country
      enum: [ "NO", DK, SE, FI ]
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: Look up a specific pickup point
    queryParameters:
      callback:
        displayName: JSONP support
        description: Callback function name.
        type: string
      requestCountryCode:
        description: Country code of the requester. Only applicable for Norwegian pickup points.
        type: string
    responses:
      200:
        displayName: Example response for id/121110
        body:
          application/json:
            example: !include examples/by_id.json
          application/xml:
            example: !include examples/by_id.xml

/{countryCode}/all{mediaTypeExtension}:
  displayName: All pickup points in a country
  uriParameters:
    countryCode:
      displayName: Country
      enum: [ "NO", DK, SE, FI ]
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: All pickup points in a country
    queryParameters:
      callback:
        displayName: JSONP support
        description: Callback function name.
        type: string
      requestCountryCode:
        description: Country code of the requester. Only applicable for Norwegian pickup points.
        type: string


Remove "NEW" from the heading

Remove "NEW" from the heading

#%RAML 0.8
---
title: Invoice API
baseUri: https://www.mybring.com

documentation:
- title: Introduction
  content: |
      The Invoice API is used to download the invoice pdfs same as in Mybring.

- title: Authentication
  content: |
    The Invoice API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be present for authenticating requests.

/invoicearchive/pdf/{customerNumberUnique}/{invoiceNumber}.pdf:
  displayName: Invoice PDF download endpoint
  securedBy: [mybring_headers, null]
  description: |
      This link is used to download the invoice pdf for the customers by providing API Customer Id and invoice number in URI params.

  uriParameters:
    customerNumberUnique:
      description: Unique API Customer Number for each customer.
    invoiceNumber:
      description: Invoice number of the particular invoice to be downloaded.

  get:
    description: Download pdf for invoice

/invoicearchive/api/invoices/{customerNumberUnique}{mediaTypeExtension}:
  displayName: List of all Invoices
  description: |
    Gets the list of invoices corresponding to the given customer number.
    By default it shows last 65 days of invoices, with the possibilty to access last 365 days by providing "fromDate" and "toDate". This endpoint supports Parcel Domestic, Parcel International and Cargo customers.
  uriParameters:
      customerNumberUnique:
        description: Unique API Customer Number.
        type: string
        required: true
      mediaTypeExtension:
        enum: [ .json, .xml ]
        description: Use .json to specify application/json or .xml to specify application/xml

  get:
    description: List invoice numbers
    queryParameters:
      fromDate:
        description: Start date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 15.01.2019
      toDate:
        description: End date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 25.01.2019

#%RAML 0.8
---
title: Invoice API
baseUri: https://www.mybring.com

documentation:
- title: Introduction
  content: |
      The Invoice API is used to download the invoice pdfs same as in Mybring.

- title: Authentication
  content: |
    The Invoice API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be present for authenticating requests.

/invoicearchive/pdf/{customerNumberUnique}/{invoiceNumber}.pdf:
  displayName: Invoice PDF download endpoint
  securedBy: [mybring_headers, null]
  description: |
      This link is used to download the invoice pdf for the customers by providing API Customer Id and invoice number in URI params.

  uriParameters:
    customerNumberUnique:
      description: Unique API Customer Number for each customer.
    invoiceNumber:
      description: Invoice number of the particular invoice to be downloaded.

  get:
    description: Download pdf for invoice

/invoicearchive/api/invoices/{customerNumberUnique}{mediaTypeExtension}:
  displayName: List of all Invoices (NEW)
  description: |
    Gets the list of invoices corresponding to the given customer number.
    By default it shows last 65 days of invoices, with the possibilty to access last 365 days by providing "fromDate" and "toDate". This endpoint supports Parcel Domestic, Parcel International and Cargo customers.
  uriParameters:
      customerNumberUnique:
        description: Unique API Customer Number.
        type: string
        required: true
      mediaTypeExtension:
        enum: [ .json, .xml ]
        description: Use .json to specify application/json or .xml to specify application/xml

  get:
    description: List invoice numbers
    queryParameters:
      fromDate:
        description: Start date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 15.01.2019
      toDate:
        description: End date for fetching invoices in format dd.mm.yyyy.
        type: string
        required: false
        example: 25.01.2019


Update ggs-api.raml

Update ggs-api.raml

#%RAML 1.0
title: GTS API
version:0.1.0
protocols: [HTTP, HTTPS]
baseUri: http://server-url/deployed-app/operations
mediatype: application/json
types: !include ggs-types.raml
/api:
	options:
		description: Retrieve specific description for resources (API)
		responses:
			200:
				body:
					application/json:
						type: ResourceDef[]
/jts:
	/buffer:
		post:
			description: calculates the geometry buffer sent in the body. Beware of the buffer in geometries with projection wgs84
			mediaType: application/json
			queryParameters:
				distance:
					displayName: distance
					type: double
					description: buffer to apply
					example: 0.5
					required: true
				segments:
					displayName: segments
					type: integer
					description: quadrants segments to build arcs.
					example: 3
					required: false
					defaultValue: 8 (see JTS documentation)
			body:
				application/json:
					type: FlatGeometry
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
	/union:
		post:
			description: calculates the geometry resulting from the union of the geometries sent in the body
			mediaType: application/json
			body:
				type: FlatGeometry[]
					miItems: 2
					uniqueItems: true
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry

/envelope:
		post:
			description: calculates the envelope of the geometry sent in the body
			mediaType: application/json
			body:
				type: FlatGeometry
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
/centroid:
		post:
			description: calculates the centroid of the geometry sent in the body
			mediaType: application/json
			body:
				type: FlatGeometry
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
/intersection:
		post:
			description: calculates the outline geometry resulting from the intersection of source and overlay data sent in the body
			mediaType: application/json
			body:
				type: OperationData
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
/intersection/elements:
		post:
			description: calculates an array of geometries resulting from the intersection of source and overlay data sent in the body
			mediaType: application/json
			body:
				type: OperationData
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry[]

#%RAML 1.0
title: GTS API
version:0.1
protocols: [HTTP, HTTPS]
baseUri: http://server-url/deployed-app/operations
mediatype: application/json
types: !include ggs-types.raml
/api:
	options:
		description: Retrieve specific description for resources (API)
		responses:
			200:
				body:
					application/json:
						type: ResourceDef[]
/jts:
	/buffer:
		post:
			description: calculates the geometry buffer sent in the body. Beware of the buffer in geometries with projection wgs84
			mediaType: application/json
			queryParameters:
				distance:
					displayName: distance
					type: double
					description: buffer to apply
					example: 0.5
					required: true
				segments:
					displayName: segments
					type: integer
					description: quadrants segments to build arcs.
					example: 3
					required: false
					defaultValue: 8 (see JTS documentation)
			body:
				application/json:
					type: FlatGeometry
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
	/union:
		post:
			description: calculates the geometry resulting from the union of the geometries sent in the body
			mediaType: application/json
			body:
				type: FlatGeometry[]
					miItems: 2
					uniqueItems: true
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry

/envelope:
		post:
			description: calculates the envelope of the geometry sent in the body
			mediaType: application/json
			body:
				type: FlatGeometry
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
/centroid:
		post:
			description: calculates the centroid of the geometry sent in the body
			mediaType: application/json
			body:
				type: FlatGeometry
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
/intersection:
		post:
			description: calculates the outline geometry resulting from the intersection of source and overlay data sent in the body
			mediaType: application/json
			body:
				type: OperationData
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry
/intersection/elements:
		post:
			description: calculates an array of geometries resulting from the intersection of source and overlay data sent in the body
			mediaType: application/json
			body:
				type: OperationData
			responses:
				201:
					body:
						application/json:
							type: FlatGeometry[]


RMB-59

RMB-59

add facet example

#%RAML 0.8

title: e-BookMobile API
baseUri: http://localhost:8081/{version}
version: v1

schemas:
  - book: !include book.schema
  - raml-util/schemas/metadata.schema: !include raml-util/schemas/metadata.schema
  - raml-util/schemas/resultInfo.schema: !include raml-util/schemas/resultInfo.schema

traits:
  - facets: !include raml-util/traits/facets.raml

/rmbtests:
  /books:
    get:
      is: [facets]
      queryParameters:
        author:
          displayName: Author
          type: string
          description: An author's full name
          example: Mary Roach
          required: true
        publicationYear:
          displayName: Pub Year
          type: number
          description: The year released for the first time in the US
          example: 1984
          required: true
        rating:
          displayName: Rating
          type: number
          description: Average rating (1-5) submitted by users
          example: 3.14
          required: false
        isbn:
          displayName: ISBN
          type: string
          minLength: 10
          example: 0321736079?
      responses:
        200:
         body:
           application/json:
            schema: book
            example: |
               {
                 "data": {
                   "id": "SbBGk",
                   "title": "Stiff: The Curious Lives of Human Cadavers",
                   "description": null,
                   "datetime": {
                     "date": "2117-08-03"
                   },
                   "genre": "science",
                   "author": "Mary Roach",
                   "link": "http://e-bookmobile.com/books/Stiff"
                 },
                 "success": true,
                 "status": 200,
                 "metaData": {
                   "createdDate": "2017-04-01T23:11:00.000Z",
                   "createdByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b"
                 }
               }

    put:
      queryParameters:
        access_token:
          displayName: Access Token
          type: number
          description: Token giving you permission to make call
          required: true
    post:
      body:
        application/json:
          schema: book
      responses:
        201:
          body:
            application/json:
              example: !include examples/bulk.sample
          headers:
            Location:
  /test:
    post:
      body:
        application/json:
      responses:
        200:
          body:
            application/json:
        302:
          headers:
            Location:

#%RAML 0.8

title: e-BookMobile API
baseUri: http://localhost:8081/{version}
version: v1

schemas:
  - book: !include book.schema
  - raml-util/schemas/metadata.schema: !include raml-util/schemas/metadata.schema

/rmbtests:
  /books:
    /{bookTitle}:
    get:
      queryParameters:
        author:
          displayName: Author
          type: string
          description: An author's full name
          example: Mary Roach
          required: true
        publicationYear:
          displayName: Pub Year
          type: number
          description: The year released for the first time in the US
          example: 1984
          required: true
        rating:
          displayName: Rating
          type: number
          description: Average rating (1-5) submitted by users
          example: 3.14
          required: false
        isbn:
          displayName: ISBN
          type: string
          minLength: 10
          example: 0321736079?
      responses:
        200:
         body:
           application/json:
            schema: book
            example: |
               {
                 "data": {
                   "id": "SbBGk",
                   "title": "Stiff: The Curious Lives of Human Cadavers",
                   "description": null,
                   "datetime": {
                     "date": "2117-08-03"
                   },
                   "genre": "science",
                   "author": "Mary Roach",
                   "link": "http://e-bookmobile.com/books/Stiff"
                 },
                 "success": true,
                 "status": 200,
                 "metaData": {
                   "createdDate": "2017-04-01T23:11:00.000Z",
                   "createdByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b"
                 }
               }

    put:
      queryParameters:
        access_token:
          displayName: Access Token
          type: number
          description: Token giving you permission to make call
          required: true
    post:
      body:
        application/json:
          schema: book
      responses:
        201:
          body:
            application/json:
              example: !include examples/bulk.sample
          headers:
            Location:
  /test:
    post:
      body:
        application/json:
      responses:
        200:
          body:
            application/json:
        302:
          headers:
            Location:


expand raml for vigia + add endpoints

expand raml for vigia + add endpoints

#%RAML 0.8
title: GrAM2
baseUri: https://api.gadz.org/{version}
version: v2

schemas:
  - group_retrive: !include groups/include_group_retrive.schema
  - account_retrive: !include accounts/include_account_retrive.schema

resourceTypes:
  - collection:
      description: Collection of available <<resourcePathName>> in GrAM.
      get:
        description: Get a list of <<resourcePathName>>.
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleCollection>>
      post:
        description: |
          Add a new <<resourcePathName|!singularize>> to GrAM.
        body:
          application/json:
            schema: <<resourcePathName|!singularize>>_create
            example: |
              <<exampleItem>>
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleCreateItemResponse>>
  - collection-item:
      description: Entity representing a <<resourcePathName|!singularize>>
      get:
        description: |
          Get the <<resourcePathName|!singularize>>
          with <<resourcePathName|!singularize>>Id =
          {<<resourcePathName|!singularize>>Id}
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleItem>>
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
      delete:
        description: |
          Delete the <<resourcePathName|!singularize>>
          with <<resourcePathName|!singularize>>Id =
          {<<resourcePathName|!singularize>>Id}
        responses:
          200:
            body:
              application/json:
                example: |
                  { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
      put:
        description: |
          Edit the <<resourcePathName|!singularize>>
          with <<resourcePathName|!singularize>>Id =
          {<<resourcePathName|!singularize>>Id}
        body:
          application/json:
            schema: <<resourcePathName|!singularize>>_edit
            example: |
              <<exampleItem>>
        responses:
          200:
            body:
              application/json:
                example: |
                  { "message": "The <<resourcePathName|!singularize>> has been properly entered" }
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
  - readOnlyCollection:
      description: Collection of available <<resourcePathName>> in GrAM.
      get:
        description: Get a list of <<resourcePathName>>.
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleCollection>>

/accounts:
  description: Collection of all accounts
  # type:
  #   collection:
  #     exampleCollection: !include accounts/include_account_collection.sample
  #     exampleItem: !include accounts/include_account_create.sample
  #     exampleCreateItemResponse : !include accounts/include_account_item.sample
  get:
    description: Get a list of accounts.
    responses:
      200:
        body:
          application/json:
            example: !include accounts/include_account_collection.sample
  post:
    description: Add a new acccount to GrAM
    body:
      application/json:
        schema: <<resourcePathName|!singularize>>_create
        example: !include accounts/include_account_create.sample
    responses:
      200:
        body:
          application/json:
            example: !include accounts/include_account_item.sample
  /{soce_id}:
    # type:
    #   collection-item:
    #     exampleItem: !include accounts/include_account_create.sample
    description: Entity representing an account
    get:
      description: |
        Get the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      responses:
        200:
          body:
            application/json:
              example: !include accounts/include_account_create.sample
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    delete:
      description: |
        Delete the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      responses:
        200:
          body:
            application/json:
              example: |
                { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    put:
      description: |
        Edit the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      body:
        application/json:
          schema: <<resourcePathName|!singularize>>_edit
          example: !include accounts/include_account_create.sample
      responses:
        200:
          body:
            application/json:
              example: |
                { "message": "The <<resourcePathName|!singularize>> has been properly entered" }
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    #/{alias}:
    /groups:
      # type:
      #   readOnlyCollection:
      #     exampleCollection: !include groups/include_group_collection.sample
      description: Collection of groups attached to this account.
      get:
        description: Get a list of groups for this account
        responses:
          200:
            body:
              application/json:
                example: !include groups/include_group_collection.sample
      post:
        description: |
          Attach a group to this account
        body:
          application/json:
            schema: <<resourcePathName|!singularize>>_create
            example: !include groups/include_group_create.sample
        responses:
          200:
            body:
              application/json:
                example: !include groups/include_group_item.sample
      /{group_short_name}:
        get:
          description: |
            Get the <<resourcePathName|!singularize>>
            with <<resourcePathName|!singularize>>Id =
            {<<resourcePathName|!singularize>>Id}
          responses:
            200:
              body:
                application/json:
                  example: !include groups/include_group_create.sample
            404:
              body:
                application/json:
                  example: |
                    {"message": "<<resourcePathName|!singularize>> not found" }
        delete:
          description: |
            Remove this group from this account
          responses:
            200:
              body:
                application/json:
                  example: |
                    { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
            404:
              body:
                application/json:
                  example: |
                    {"message": "<<resourcePathName|!singularize>> not found" }

    /roles:
      description: Appplications' roles for this user
      # type:
      #   readOnlyCollection:
      #     exampleCollection: !include roles/include_role_collection.sample
      get:
        description: Get a list of roles for this account.
        responses:
          200:
            body:
              application/json:
                example: !include roles/include_role_collection.sample
      post:
        description: |
          Add a new role to this account.
        body:
          application/json:
            schema: <<resourcePathName|!singularize>>_create
            example: !include roles/include_role_create.sample
        responses:
          200:
            body:
              application/json:
                example: !include roles/include_role_item.sample
      /{role_name}:
        # type:
        #   collection-item:
        #     exampleItem: !include roles/include_role_create.sample
        get:
          description: |
            Get the <<resourcePathName|!singularize>>
            with <<resourcePathName|!singularize>>Id =
            {<<resourcePathName|!singularize>>Id}
          responses:
            200:
              body:
                application/json:
                  example: !include roles/include_role_create.sample
            404:
              body:
                application/json:
                  example: |
                    {"message": "<<resourcePathName|!singularize>> not found" }
        delete:
          description: |
            Delete the <<resourcePathName|!singularize>>
            with <<resourcePathName|!singularize>>Id =
            {<<resourcePathName|!singularize>>Id}
          responses:
            200:
              body:
                application/json:
                  example: |
                    { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
            404:
              body:
                application/json:
                  example: |
                    {"message": "<<resourcePathName|!singularize>> not found" }
    #/{subscriptions}:
      #description: Services subscribtions
/groups:
  description: Collection of all groups
  # type:
  #   collection:
  #     exampleCollection: !include groups/include_group_collection.sample
  #     exampleItem: !include groups/include_group_create.sample
  #     exampleCreateItemResponse : !include groups/include_group_item.sample
  get:
    description: Get a list of groups.
    responses:
      200:
        body:
          application/json:
            example: !include groups/include_group_collection.sample
  post:
    description: |
      Add a new group to GrAM.
    body:
      application/json:
        schema: <<resourcePathName|!singularize>>_create
        example: !include groups/include_group_create.sample
    responses:
      200:
        body:
          application/json:
            example: !include groups/include_group_item.sample
  /{group_short_name}:
    # type:
    #   collection-item:
    #     exampleItem: !include groups/include_group_create.sample
    get:
      description: |
        Get the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      responses:
        200:
          body:
            application/json:
              example: !include groups/include_group_create.sample
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    delete:
      description: |
        Delete the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      responses:
        200:
          body:
            application/json:
              example: |
                { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    put:
      description: |
        Edit the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      body:
        application/json:
          schema: <<resourcePathName|!singularize>>_edit
          example: !include groups/include_group_create.sample
      responses:
        200:
          body:
            application/json:
              example: |
                { "message": "The <<resourcePathName|!singularize>> has been properly entered" }
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
/roles:
  description: Collection of all appplications' roles
  # type:
  #   collection:
  #     exampleCollection: !include roles/include_role_collection.sample
  #     exampleItem: !include roles/include_role_create.sample
  #     exampleCreateItemResponse : !include roles/include_role_item.sample
  get:
    description: Get a list of <<resourcePathName>>.
    responses:
      200:
        body:
          application/json:
            example: !include roles/include_role_collection.sample
  post:
    description: |
      Atach a group to this account.
    body:
      application/json:
        schema: <<resourcePathName|!singularize>>_create
        example: !include roles/include_role_create.sample
    responses:
      200:
        body:
          application/json:
            example: !include roles/include_role_item.sample
  /{role_name}:
    # type:
    #   collection-item:
    #     exampleItem: !include roles/include_role_create.sample
    get:
      description: |
        Get the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      responses:
        200:
          body:
            application/json:
              example: !include roles/include_role_create.sample
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    delete:
      description: |
        Remove a group from this account
      responses:
        200:
          body:
            application/json:
              example: |
                { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
        404:
          body:
            application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
    /accounts:
      # type:
      #   readOnlyCollection:
      #     exampleCollection: !include accounts/include_account_collection.sample
      description: Collection of available <<resourcePathName>> in GrAM.
      get:
        description: Get a list of <<resourcePathName>>.
        responses:
          200:
            body:
              application/json:
                example: !include accounts/include_account_collection.sample
#/services:
  #/{service_name}:

#%RAML 0.8
title: GrAM2
baseUri: https://api.gadz.org/{version}
version: v2

schemas:
  - group_retrive: !include groups/include_group_retrive.schema
  - account_retrive: !include accounts/include_account_retrive.schema

resourceTypes:
  - collection:
      description: Collection of available <<resourcePathName>> in GrAM.
      get:
        description: Get a list of <<resourcePathName>>.
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleCollection>>
      post:
        description: |
          Add a new <<resourcePathName|!singularize>> to GrAM.
        body:
          application/json:
            schema: <<resourcePathName|!singularize>>_create
            example: |
              <<exampleItem>>
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleCreateItemResponse>>
  - collection-item:
      description: Entity representing a <<resourcePathName|!singularize>>
      get:
        description: |
          Get the <<resourcePathName|!singularize>>
          with <<resourcePathName|!singularize>>Id =
          {<<resourcePathName|!singularize>>Id}
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleItem>>
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
      delete:
        description: |
          Delete the <<resourcePathName|!singularize>>
          with <<resourcePathName|!singularize>>Id =
          {<<resourcePathName|!singularize>>Id}
        responses:
          200:
            body:
              application/json:
                example: |
                  { "message": "The <<resourcePathName|!singularize>> {accountID} has been properly deleted" }
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
      put:
        description: |
          Edit the <<resourcePathName|!singularize>>
          with <<resourcePathName|!singularize>>Id =
          {<<resourcePathName|!singularize>>Id}
        body:
          application/json:
            schema: <<resourcePathName|!singularize>>_edit
            example: |
              <<exampleItem>>
        responses:
          200:
            body:
              application/json:
                example: |
                  { "message": "The <<resourcePathName|!singularize>> has been properly entered" }
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
  - readOnlyCollection:
      description: Collection of available <<resourcePathName>> in GrAM.
      get:
        description: Get a list of <<resourcePathName>>.
        responses:
          200:
            body:
              application/json:
                example: |
                  <<exampleCollection>>

/accounts:
  description: Collection of all accounts
  type:
    collection:
      exampleCollection: !include accounts/include_account_collection.sample
      exampleItem: !include accounts/include_account_create.sample
      exampleCreateItemResponse : !include accounts/include_account_item.sample
  /{soce_id}:
    type:
      collection-item:
        exampleItem: !include accounts/include_account_create.sample
    #/{alias}:
    /groups:
      type:
        readOnlyCollection:
          exampleCollection: !include groups/include_group_collection.sample
    /roles:
      description: Appplications' roles for this user
      type:
        readOnlyCollection:
          exampleCollection: !include roles/include_role_collection.sample

    #/{subscriptions}:
      #description: Services subscribtions
/groups:
  description: Collection of all groups
  type:
    collection:
      exampleCollection: !include groups/include_group_collection.sample
      exampleItem: !include groups/include_group_create.sample
      exampleCreateItemResponse : !include groups/include_group_item.sample
  /{group_short_name}:
    type:
      collection-item:
        exampleItem: !include groups/include_group_create.sample
/roles:
  description: Collection of all appplications' roles
  type:
    collection:
      exampleCollection: !include roles/include_role_collection.sample
      exampleItem: !include roles/include_role_create.sample
      exampleCreateItemResponse : !include roles/include_role_item.sample
  /{name}:
    type:
      collection-item:
        exampleItem: !include roles/include_role_create.sample
    /accounts:
      type:
        readOnlyCollection:
          exampleCollection: !include accounts/include_account_collection.sample
#/services:
  #/{service_name}:


added notification resource into specification;

#%RAML 0.8
title: CPDN REST API
version: v1
baseUri: https://api.cpdn.sd2.cz/{version}
mediaType: application/json
protocols: [ HTTPS ]
securedBy: [ oauth_2_0 ]

securitySchemes:
  - oauth_2_0: !include schemes/oauth2.raml

resourceTypes:
  - collection-read: !include types/collection-read.raml
  - collection-read-create: !include types/collection-read-create.raml
  - item-read: !include types/item-read.raml
  - item-read-update: !include types/item-read-update.raml
  - item-read-delete: !include types/item-read-delete.raml
  - item-read-update-delete: !include types/item-read-update-delete.raml
  - item-create-delete: !include types/item-create-delete.raml

traits:
  - paged: !include traits/paged.raml
  - searchable: !include traits/searchable.raml
  - sortable: !include traits/sortable.raml

/schemes:
  description: Scheme root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/schemes.json
      exampleCreateItem: !include samples/create-body/scheme.json
      searchableDoc: (description=string;name=string;version=int)
      sortableDoc: (description,name,version)
  /{scheme_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/scheme.json
          exampleUpdateItem: !include samples/update-body/scheme.json
    /nodes:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-nodes.json
          searchableDoc: (mapPoint=int)
          sortableDoc: (mapPoint)
    /sections:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-sections.json
          searchableDoc: (nodeSrc=int;nodeDst=int;nodeTrc=int)
          sortableDoc: (nodeSrc,nodeDst,nodeTrc)
    /mapPoints:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-mapPoints.json
          searchableDoc: (gpsLat=double;gpsLon=double;gpsAlt=double;node=int;x=double;y=double)
          sortableDoc: (gpsLat,gpsLon,gpsAlt,node,x,y)
    /objects:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-objects.json
          searchableDoc: (name=string;scheme=int)
          sortableDoc: (name,scheme)
    /permissions:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-permissions.json
          searchableDoc: ()
          sortableDoc: ()
    /requests:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-requests.json
          searchableDoc: ()
          sortableDoc: ()

/nodes:
  description: Node root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/nodes.json
      exampleCreateItem: !include samples/create-body/node.json
      searchableDoc: (mapPoint=int;scheme=int)
      sortableDoc: (mapPoint,scheme)
  /{node_id}:
    type:
        item-read-delete:
          exampleReadItem: !include samples/read-body/node.json
    /calc:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-calc.json
          exampleUpdateItem: !include samples/update-body/node-calc.json
    /mapPoint:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-mapPoint.json
          exampleUpdateItem: !include samples/update-body/node-mapPoint.json
    /scheme:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-scheme.json
          exampleUpdateItem: !include samples/update-body/node-scheme.json
    /spec:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-spec.json
          exampleUpdateItem: !include samples/update-body/node-spec.json

/sections:
  description: Section root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/sections.json
      exampleCreateItem: !include samples/create-body/section.json
      searchableDoc: (nodeSrc=int;nodeDst=int;nodeTrc=int;scheme=int)
      sortableDoc: (nodeSrc,nodeDst,nodeTrc,scheme)
  /{section_id}:
    type:
        item-read-delete:
          exampleReadItem: !include samples/read-body/section.json
    /calc:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-calc.json
          exampleUpdateItem: !include samples/update-body/section-calc.json
    /nodes:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-nodes.json
          exampleUpdateItem: !include samples/update-body/section-nodes.json
    /paths:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/section-paths.json
          searchableDoc: (mapPointSrc=int;mapPointDst=int)
          sortableDoc: (mapPointSrc,mapPointDst)
    /scheme:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-scheme.json
          exampleUpdateItem: !include samples/update-body/section-scheme.json
    /spec:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-spec.json
          exampleUpdateItem: !include samples/update-body/section-spec.json

/mapPoints:
  description: MapPoint root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/mapPoints.json
      exampleCreateItem: !include samples/create-body/mapPoint.json
      searchableDoc: (gpsLat=double;gpsLon=double;gpsAlt=double;node=int;scheme=int;x=double;y=double)
      sortableDoc: (gpsLat,gpsLon,gpsAlt,node,scheme,x,y)
  /{mapPoint_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/mapPoint.json
          exampleUpdateItem: !include samples/update-body/mapPoint.json

/paths:
  description: Path root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/paths.json
      exampleCreateItem: !include samples/create-body/path.json
      searchableDoc: (mapPointSrc=int;mapPointDst=int;section=int)
      sortableDoc: (mapPointSrc,mapPointDst,section)
  /{path_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/path.json
          exampleUpdateItem: !include samples/update-body/path.json
/objects:
  description: Object root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/objects.json
      exampleCreateItem: !include samples/create-body/object.json
      searchableDoc: (name=string;scheme=int)
      sortableDoc: (name,scheme)
  /{object_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/object.json
          exampleUpdateItem: !include samples/update-body/object.json
    /nodes:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/object-nodes.json
          searchableDoc: (mapPoint=int)
          sortableDoc: (mapPoint)
    /node/{node_id}:
      description: Create/delete relation between object_id and node_id
      type:
        item-create-delete:
          exampleCreateItem: !include samples/create-body/object-node.json
/notifications:
  description: Notification root resource
  type:
    collection-read:
      exampleCollection: !include samples/read-body/notifications.json
      searchableDoc: (user=int;title=string;tsCreate=string-time;tsRead=string-time)
      sortableDoc: (user,title,tsCreate,tsRead)
  /{notification_id}:
    type:
        item-read-update:
          exampleReadItem: !include samples/read-body/notification.json
          exampleUpdateItem: !include samples/update-body/notification.json

/permissions:
  description: Schema permissions root resource

/requests:
  description: Schema requests root resource

#%RAML 0.8
title: CPDN REST API
version: v1
baseUri: https://api.cpdn.sd2.cz/{version}
mediaType: application/json
protocols: [ HTTPS ]
securedBy: [ oauth_2_0 ]

securitySchemes:
  - oauth_2_0: !include schemes/oauth2.raml

resourceTypes:
  - collection-read: !include types/collection-read.raml
  - collection-read-create: !include types/collection-read-create.raml
  - item-read: !include types/item-read.raml
  - item-read-update: !include types/item-read-update.raml
  - item-read-delete: !include types/item-read-delete.raml
  - item-read-update-delete: !include types/item-read-update-delete.raml
  - item-create-delete: !include types/item-create-delete.raml

traits:
  - paged: !include traits/paged.raml
  - searchable: !include traits/searchable.raml
  - sortable: !include traits/sortable.raml

/schemes:
  description: Scheme root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/schemes.json
      exampleCreateItem: !include samples/create-body/scheme.json
      searchableDoc: (description=string;name=string;version=int)
      sortableDoc: (description,name,version)
  /{scheme_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/scheme.json
          exampleUpdateItem: !include samples/update-body/scheme.json
    /nodes:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-nodes.json
          searchableDoc: (mapPoint=int)
          sortableDoc: (mapPoint)
    /sections:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-sections.json
          searchableDoc: (nodeSrc=int;nodeDst=int;nodeTrc=int)
          sortableDoc: (nodeSrc,nodeDst,nodeTrc)
    /mapPoints:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-mapPoints.json
          searchableDoc: (gpsLat=double;gpsLon=double;gpsAlt=double;node=int;x=double;y=double)
          sortableDoc: (gpsLat,gpsLon,gpsAlt,node,x,y)
    /objects:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-objects.json
          searchableDoc: (name=string;scheme=int)
          sortableDoc: (name,scheme)
    /permissions:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-permissions.json
          searchableDoc: ()
          sortableDoc: ()
    /requests:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/scheme-requests.json
          searchableDoc: ()
          sortableDoc: ()

/nodes:
  description: Node root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/nodes.json
      exampleCreateItem: !include samples/create-body/node.json
      searchableDoc: (mapPoint=int;scheme=int)
      sortableDoc: (mapPoint,scheme)
  /{node_id}:
    type:
        item-read-delete:
          exampleReadItem: !include samples/read-body/node.json
    /calc:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-calc.json
          exampleUpdateItem: !include samples/update-body/node-calc.json
    /mapPoint:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-mapPoint.json
          exampleUpdateItem: !include samples/update-body/node-mapPoint.json
    /scheme:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-scheme.json
          exampleUpdateItem: !include samples/update-body/node-scheme.json
    /spec:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/node-spec.json
          exampleUpdateItem: !include samples/update-body/node-spec.json

/sections:
  description: Section root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/sections.json
      exampleCreateItem: !include samples/create-body/section.json
      searchableDoc: (nodeSrc=int;nodeDst=int;nodeTrc=int;scheme=int)
      sortableDoc: (nodeSrc,nodeDst,nodeTrc,scheme)
  /{section_id}:
    type:
        item-read-delete:
          exampleReadItem: !include samples/read-body/section.json
    /calc:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-calc.json
          exampleUpdateItem: !include samples/update-body/section-calc.json
    /nodes:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-nodes.json
          exampleUpdateItem: !include samples/update-body/section-nodes.json
    /paths:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/section-paths.json
          searchableDoc: (mapPointSrc=int;mapPointDst=int)
          sortableDoc: (mapPointSrc,mapPointDst)
    /scheme:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-scheme.json
          exampleUpdateItem: !include samples/update-body/section-scheme.json
    /spec:
      type:
        item-read-update:
          exampleReadItem: !include samples/read-body/section-spec.json
          exampleUpdateItem: !include samples/update-body/section-spec.json

/mapPoints:
  description: MapPoint root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/mapPoints.json
      exampleCreateItem: !include samples/create-body/mapPoint.json
      searchableDoc: (gpsLat=double;gpsLon=double;gpsAlt=double;node=int;scheme=int;x=double;y=double)
      sortableDoc: (gpsLat,gpsLon,gpsAlt,node,scheme,x,y)
  /{mapPoint_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/mapPoint.json
          exampleUpdateItem: !include samples/update-body/mapPoint.json

/paths:
  description: Path root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/paths.json
      exampleCreateItem: !include samples/create-body/path.json
      searchableDoc: (mapPointSrc=int;mapPointDst=int;section=int)
      sortableDoc: (mapPointSrc,mapPointDst,section)
  /{path_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/path.json
          exampleUpdateItem: !include samples/update-body/path.json

/objects:
  description: Object root resource
  type:
    collection-read-create:
      exampleCollection: !include samples/read-body/objects.json
      exampleCreateItem: !include samples/create-body/object.json
      searchableDoc: (name=string;scheme=int)
      sortableDoc: (name,scheme)
  /{object_id}:
    type:
        item-read-update-delete:
          exampleReadItem: !include samples/read-body/object.json
          exampleUpdateItem: !include samples/update-body/object.json
    /nodes:
      type:
        collection-read:
          exampleCollection: !include samples/read-body/object-nodes.json
          searchableDoc: (mapPoint=int)
          sortableDoc: (mapPoint)
    /node/{node_id}:
      description: Create/delete relation between object_id and node_id
      type:
        item-create-delete:
          exampleCreateItem: !include samples/create-body/object-node.json

/permissions:
  description: Schema permissions root resource

/requests:
  description: Schema requests root resource