Fix project raml

Fix project raml

/{ProjectId}/template:
  uriParameters:
    ProjectId:
      type: string
      required: true
  post:
    description: Set the session template for a project
    body:
      application/json:
        example: !include ../examples/input/project-template.json
        schema: !include ../schemas/input/project-template.json
    responses:
      200:
        description: Template was saved
        body:
          application/json:
            example: |
              {"modified": 1}
      404:
        description: Project was not found

/{ProjectId}/template/recalc:
  uriParameters:
    ProjectId:
      type: string
      required: true
  post:
    description: |
      Recalculate if sessions in the project satisfy the template.
      Returns list of modified sessions
    responses:
      200:
        description: |
          Project's sessions' compliance was recalculated.
          Returns list of session that were modified.
      404:
        description: Project was not found

/{ProjectId}/template:
  uriParameters:
    ProjectId:
      type: string
      required: true
  post:
    description: Set the session template for a project
    body:
      application/json:
        example: !include ../examples/input/project-template.json
        schema: !include ../schemas/input/project-template.json
    responses:
      200:
        description: Template was saved
        body:
          application/json:
            example: |
              {"modified": 1}
      404:
        description: Project was not found

/{ProjectId}/template/recalc:
  uriParameters:
    ProjectId:
      type: string
      required: true
  post:
    description: |
      Recalculate if sessions in the project satisfy the template.
      Returns list of modified sessions
    body:
      application/json:
        example: !include ../examples/input/project-template.json
        schema: !include ../schemas/input/project-template.json
    responses:
      200:
        description: |
          Project's sessions' compliance was recalculated.
          Returns list of session that were modified.
      404:
        description: Project was not found


adding quotes to urls (otherwise java parser refures to parse it)

#%RAML 1.0 Library
uses:
  commons: "https://raw.githubusercontent.com/apiregistry/commons/master/commons.raml"
usage: |
  This library contains set of annotations which may be used to, customize mapping
  of RAML types to Java as well as a set of similar languages (Scala,e.t.c)
annotationTypes:
  package:
    type: string
    description: |
      This annotation allows to specify desired package name for the generated types
      When applied to type container works as the default package
      name for all types in scope
    allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension]
  primarySuperType:
    type: TypeName
    allowedTargets: TypeDeclaration
    description: |
      When RAML type with multiple super types is mapped to language without
      support for multiple inheritance only one of super types may be used
      as a real super type in the target language. This annotation allows to specify
      the name of super type which should be used as primary super type in this case.
  container:
     type: string
     enum: [array, list, set]
     allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension]
     description: |
       Trivial mapping of RAML array types, is to map them to array types of the target language
       however this behavior is not always desired. This annotation allows to customize
       desired type of the container type when mapping array types. When used on type container
       serves as default for all contained types.
     default: array
types:
  JavaPackage: string
  TypeName: string
(commons.Authors):
  - name: Pavel Petrochenko
    email: pavel@onpositive.com
    profiles: [ "https://github.com/petrochenko-pavel-a/" ]
(commons.Id): org.aml.java.mapping
(commons.Version): 0.0.1
(commons.Title): RAML2Java Annotations
(commons.Links):
   - title: RAML2Java Tool
     url: "https://github.com/OnPositive/aml"
     role: Tool Location

#%RAML 1.0 Library
uses:
  commons: https://raw.githubusercontent.com/apiregistry/commons/master/commons.raml
usage: |
  This library contains set of annotations which may be used to, customize mapping
  of RAML types to Java as well as a set of similar languages (Scala,e.t.c)
annotationTypes:
  package:
    type: string
    description: |
      This annotation allows to specify desired package name for the generated types
      When applied to type container works as the default package
      name for all types in scope
    allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension]
  primarySuperType:
    type: TypeName
    allowedTargets: TypeDeclaration
    description: |
      When RAML type with multiple super types is mapped to language without
      support for multiple inheritance only one of super types may be used
      as a real super type in the target language. This annotation allows to specify
      the name of super type which should be used as primary super type in this case.
  container:
     type: string
     enum: [array, list, set]
     allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension]
     description: |
       Trivial mapping of RAML array types, is to map them to array types of the target language
       however this behavior is not always desired. This annotation allows to customize
       desired type of the container type when mapping array types. When used on type container
       serves as default for all contained types.
     default: array
types:
  JavaPackage: string
  TypeName: string
(commons.Authors):
  - name: Pavel Petrochenko
    email: pavel@onpositive.com
    profiles: [ https://github.com/petrochenko-pavel-a/ ]
(commons.Id): org.aml.java.mapping
(commons.Version): 0.0.1
(commons.Title): RAML2Java Annotations
(commons.Links):
   - title: RAML2Java Tool
     url: https://github.com/OnPositive/aml
     role: Tool Location


Removed text on includeMetadata that was not valid anymore

#%RAML 1.0
title: Digitale Delta - API
version: 2.0.1
securitySchemes:
  basic:
    type: Basic Authentication
  openidconnect:
    type: OAuth 2.0
baseUri: http://api.rws.nl/dl/
mediaType: [ application/json ]
description: Digital Delta API version 2.0.1
documentation:
 - title: Introduction
   content: !include documentation/dd/Introduction.md
 - title: Document history
   content: !include documentation/dd/Document_History.md
 - title: The API specification
   content: !include documentation/dd/The_API_Specification.md
 - title: End points specification
   content: !include documentation/dd/End_Points_Specification.md

# HTTP is included as protocol but is optional as for security reasons a Provider might decide to support HTTPS only.
protocols:
  - HTTP
  - HTTPS

uses:
  DD-T: libraries/dd-base-types.raml
  GENERIC-RESP: libraries/generic-response-types.raml
  DD-RESP: libraries/dd-response-types.raml
  TRAITS: libraries/dd-traits.raml

#
# All data types are defined in external files (see above) so they can be shared between DD and DD-OPER API.
#
types:

#
# The resources
/dd/2.0:

# ##################################################

  /nodes:
    get:
      description: |
        A (data)node is an area from which resource objects can be retrieved.
      is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        name?:
          type: string
          description: (Partial) name of the node. Partial meaning startsWith(...).
          example: RwsPrimaryNode
      responses:
        200:
          description: |
            Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.NodeListResponse
              example: !include examples/dd-nodelist-response.json
    /{nodeId}:
      uriParameters:
        nodeId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: Request a specific Node by its unique dentifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.NodeResponse
                example: !include examples/dd-node-response.json

# ##################################################

  /sources:
    is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
    get:
      description: |
        A (data)source describes the source of the data. A node can have multiple data sources.
      queryParameters:
        process?:
          type: DD-T.ProcessName
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.SourceListResponse
              example: !include examples/dd-sourcelist-response.json

# #####################################################

  /locations:
    get:
      description: |
        Location objects contains all information required to describe a location.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.locationFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        boundingBox?:
          type: DD-T.BoundingBox
        locationName?:
          type: DD-T.LocationName
        nodeId?:
          type: DD-T.Identifier
          description: This query parameter is deprecated.
        locationCode?:
          type: DD-T.LocationCode
        locationId?:
          type: DD-T.Identifier
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.LocationListResponse
              example: !include examples/dd-locationslist-response.json

    /geojson:
      get:
        description: |
          Retrieve location resources. Response is in GeoJSON FeatureCollection format (see https://tools.ietf.org/html/rfc7946#page-12).
        is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.locationFilterable ]
        queryParameters:
          process?:
            type: DD-T.ProcessName
          boundingBox?:
            type: DD-T.BoundingBox
          locationName?:
            type: DD-T.LocationName
          nodeId?:
            type: DD-T.Identifier
            description: This query parameter is deprecated.
          locationCode?:
            type: DD-T.LocationCode
          locationId?:
            type: DD-T.Identifier
        responses:
          200:
            description: Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.LocationListResponseGeoJSON
                example: !include examples/dd-locationslist-response-geojson.json

    /{locationId}:
      description: Request a specific location by its id. Response is always in GeoJSON Feature format (see https://tools.ietf.org/html/rfc7946#page-11).
      uriParameters:
        locationId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: |
          Request a specific Location by its unique dentifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: object
                example: !include examples/dd-location-response-geojson.json

######################################################

  /observationTypes:
    get:
      description: |
        ObservationType objects describe all attributes to correctly interpret what has been measured, and in what way. It is essential to have the quantity field.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        observationTypeId?:
          type: DD-T.Identifier
        quantity?:
          description: Retrieve only observation types that contain the specified quantity.
          type: string
        parameterCode?:
          description: Retrieve only observation types that contain the specified parameter code.
          type: string
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.ObservationTypeListResponse
              example: !include examples/dd-observationtypelist-response.json

    /{observationTypeId}:
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      uriParameters:
        observationTypeId:
          type: DD-T.Identifier
      get:
        description: Request a specific ObservationType by its unique identifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.ObservationTypeResponse
                example: !include examples/dd-observationtype-response.json

######################################################

  /timeseries:
    get:
      description: |
        TimeSeriesType objects describe the type of measurement the timeseries contains. These can be for example raw measurements, but also aggregations or simulations. This information could be needed to correctly interpret the measurement values.
        A request where both startTime and endTime are omitted returns a response with just the metadata.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.timeseriesFilterable, TRAITS.locationFilterable, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        startTime?:
          type: DD-T.StartTime
        endTime?:
          type: DD-T.EndTime
        locationCode?:
          type: DD-T.LocationCode
        locationName?:
          type: DD-T.LocationName
        sourceName?:
          type: DD-T.SourceName
        observationTypeId?:
          type: DD-T.Identifier
        realizationCount?:
          description: Added Count as this is the name in ObservationType response.
          type: integer
        parameterCode?:
          description: Implementation is optional. Preferably to be implemented by means of the generic filtering mechanism.
          type: string
        quantity?:
          description: Implementation is optional. Preferably to be implemented by means of the generic filtering mechanism.
          type: string
        valueType?:
          description: Value type (float, integer, categorized).
          type: string
        nodeId?:
          type: DD-T.Identifier
        qualifier?:
          description: Filter for the optional qualifier property.
          type: string
        aspectSet?:
          type: DD-T.AspectSetName
          description: Remark: Only required for systems that implement aspect sets
        quantityName?:
          type: DD-T.QuantityName
          description: Remark: Only required for systems that are accessed by RWS's MKK-DL
        intervalLength?:
          type: DD-T.IntervalLength
          description: Remark: Only required for systems that are accessed by RWS's MKK-DL
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.TimeseriesListResponse
              example: !include examples/dd-timeserieslist-response-verwachtingen-en-metingen-fulldd.json

    /{timeseriesId}:
      uriParameters:
        timeseriesId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: Request a specific (single) Timeseries by its unique identifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: DD-RESP.TimeseriesResponse
                example: !include examples/dd-timeseries-response-single.json

#%RAML 1.0
title: Digitale Delta - API
version: 2.0.1
securitySchemes:
  basic:
    type: Basic Authentication
  openidconnect:
    type: OAuth 2.0
baseUri: http://api.rws.nl/dl/
mediaType: [ application/json ]
description: Digital Delta API version 2.0.1
documentation:
 - title: Introduction
   content: !include documentation/dd/Introduction.md
 - title: Document history
   content: !include documentation/dd/Document_History.md
 - title: The API specification
   content: !include documentation/dd/The_API_Specification.md
 - title: End points specification
   content: !include documentation/dd/End_Points_Specification.md

# HTTP is included as protocol but is optional as for security reasons a Provider might decide to support HTTPS only.
protocols:
  - HTTP
  - HTTPS

uses:
  DD-T: libraries/dd-base-types.raml
  GENERIC-RESP: libraries/generic-response-types.raml
  DD-RESP: libraries/dd-response-types.raml
  TRAITS: libraries/dd-traits.raml

#
# All data types are defined in external files (see above) so they can be shared between DD and DD-OPER API.
#
types:

#
# The resources
/dd/2.0:

# ##################################################

  /nodes:
    get:
      description: |
        A (data)node is an area from which resource objects can be retrieved.
      is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        name?:
          type: string
          description: (Partial) name of the node. Partial meaning startsWith(...).
          example: RwsPrimaryNode
      responses:
        200:
          description: |
            Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.NodeListResponse
              example: !include examples/dd-nodelist-response.json
    /{nodeId}:
      uriParameters:
        nodeId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: Request a specific Node by its unique dentifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.NodeResponse
                example: !include examples/dd-node-response.json

# ##################################################

  /sources:
    is: [ TRAITS.pageable, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError ]
    get:
      description: |
        A (data)source describes the source of the data. A node can have multiple data sources.
      queryParameters:
        process?:
          type: DD-T.ProcessName
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.SourceListResponse
              example: !include examples/dd-sourcelist-response.json

# #####################################################

  /locations:
    get:
      description: |
        Location objects contains all information required to describe a location.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.locationFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        boundingBox?:
          type: DD-T.BoundingBox
        locationName?:
          type: DD-T.LocationName
        nodeId?:
          type: DD-T.Identifier
          description: This query parameter is deprecated.
        locationCode?:
          type: DD-T.LocationCode
        locationId?:
          type: DD-T.Identifier
      responses:
        200:
          description: Succesfully retrieved resource.
          body:
            application/json:
              type: DD-RESP.LocationListResponse
              example: !include examples/dd-locationslist-response.json

    /geojson:
      get:
        description: |
          Retrieve location resources. Response is in GeoJSON FeatureCollection format (see https://tools.ietf.org/html/rfc7946#page-12).
        is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.locationFilterable ]
        queryParameters:
          process?:
            type: DD-T.ProcessName
          boundingBox?:
            type: DD-T.BoundingBox
          locationName?:
            type: DD-T.LocationName
          nodeId?:
            type: DD-T.Identifier
            description: This query parameter is deprecated.
          locationCode?:
            type: DD-T.LocationCode
          locationId?:
            type: DD-T.Identifier
        responses:
          200:
            description: Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.LocationListResponseGeoJSON
                example: !include examples/dd-locationslist-response-geojson.json

    /{locationId}:
      description: Request a specific location by its id. Response is always in GeoJSON Feature format (see https://tools.ietf.org/html/rfc7946#page-11).
      uriParameters:
        locationId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: |
          Request a specific Location by its unique dentifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: object
                example: !include examples/dd-location-response-geojson.json

######################################################

  /observationTypes:
    get:
      description: |
        ObservationType objects describe all attributes to correctly interpret what has been measured, and in what way. It is essential to have the quantity field.
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        observationTypeId?:
          type: DD-T.Identifier
        quantity?:
          description: Retrieve only observation types that contain the specified quantity.
          type: string
        parameterCode?:
          description: Retrieve only observation types that contain the specified parameter code.
          type: string
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.ObservationTypeListResponse
              example: !include examples/dd-observationtypelist-response.json

    /{observationTypeId}:
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      uriParameters:
        observationTypeId:
          type: DD-T.Identifier
      get:
        description: Request a specific ObservationType by its unique identifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
        responses:
          200:
            description: |
              Succesfully retrieved resource.
            body:
              application/json:
                type: DD-RESP.ObservationTypeResponse
                example: !include examples/dd-observationtype-response.json

######################################################

  /timeseries:
    get:
      description: |
        TimeSeriesType objects describe the type of measurement the timeseries contains. These can be for example raw measurements, but also aggregations or simulations. This information could be needed to correctly interpret the measurement values.
        A request where both startTime and endTime are omitted returns a response with just the metadata (implicit includeMetaData = true).
      is: [ TRAITS.pageable, TRAITS.has400-InvalidRequestError, TRAITS.has403-AccessDeniedError, TRAITS.has500-ServerError, TRAITS.timeseriesFilterable, TRAITS.locationFilterable, TRAITS.observationTypeFilterable ]
      queryParameters:
        process?:
          type: DD-T.ProcessName
        startTime?:
          type: DD-T.StartTime
        endTime?:
          type: DD-T.EndTime
        locationCode?:
          type: DD-T.LocationCode
        locationName?:
          type: DD-T.LocationName
        sourceName?:
          type: DD-T.SourceName
        observationTypeId?:
          type: DD-T.Identifier
        realizationCount?:
          description: Added Count as this is the name in ObservationType response.
          type: integer
        parameterCode?:
          description: Implementation is optional. Preferably to be implemented by means of the generic filtering mechanism.
          type: string
        quantity?:
          description: Implementation is optional. Preferably to be implemented by means of the generic filtering mechanism.
          type: string
        valueType?:
          description: Value type (float, integer, categorized).
          type: string
        nodeId?:
          type: DD-T.Identifier
        qualifier?:
          description: Filter for the optional qualifier property.
          type: string
        aspectSet?:
          type: DD-T.AspectSetName
          description: Remark: Only required for systems that implement aspect sets
        quantityName?:
          type: DD-T.QuantityName
          description: Remark: Only required for systems that are accessed by RWS's MKK-DL
        intervalLength?:
          type: DD-T.IntervalLength
          description: Remark: Only required for systems that are accessed by RWS's MKK-DL
      responses:
        200:
          description: |
            Succesfully retrieved timeseries.
          body:
            application/json:
              type: DD-RESP.TimeseriesListResponse
              example: !include examples/dd-timeserieslist-response-verwachtingen-en-metingen-fulldd.json

    /{timeseriesId}:
      uriParameters:
        timeseriesId:
          type: DD-T.Identifier
      is: [ TRAITS.has403-AccessDeniedError, TRAITS.has404-NotFoundError, TRAITS.has500-ServerError ]
      get:
        description: Request a specific (single) Timeseries by its unique identifier.
        queryParameters:
          process?:
            type: DD-T.ProcessName
            default: measurement
        responses:
          200:
            description: |
              Succesfully retrieved resource
            body:
              application/json:
                type: DD-RESP.TimeseriesResponse
                example: !include examples/dd-timeseries-response-single.json


replaced version of resourceType element

#%RAML 0.8
title: Wishlist Service
baseUri: http://localhost/
version: v1
mediaType:  application/json

schemas:
  - error: !include https://api.yaas.io/patterns/v1/schema-error-message.json
  - documentMetaData: !include document/MetaData.json
  - documentPostResponse: !include document/POSTresponse.json
  - documentWishlist: !include document/Wishlist.json
  - documentWishlistItem: !include document/WishlistItem.json
  - documentWishlistItemRead: !include document/WishlistItemRead.json
  - documentWishlistRead: !include document/WishlistRead.json
  - documentWishlistMedia: !include document/WishlistMedia.json
  - documentWishlistMediaRead: !include document/WishlistMediaRead.json
  - resourceLocation: !include https://api.yaas.io/patterns/v1/schema-resource-location.json
  - customer: !include customer.json
  - wishlist: !include wishlist.json
  - wishlistItem: !include wishlistItem.json
  - wishlistItems: !include wishlistItems.json
  - wishlists: !include wishlists.json
  - wishlistMedia: !include wishlistMedia.json
  - wishlistMedias: !include wishlistMedias.json

traits:
  - !include https://api.yaas.io/patterns/v1/trait-yaas-aware.yaml
  - !include https://api.yaas.io/patterns/v2/trait-paged.yaml
  - !include https://api.yaas.io/patterns/v1/trait-countable.yaml

resourceTypes:
  - !include https://api.yaas.io/patterns/v2/resource-type-element.yaml
  - !include https://api.yaas.io/patterns/v1/resource-type-collection.yaml

/wishlists:
  type: collection
  is: [yaasAware]
  get:
    is: [paged,countable]
    description: Get all wishlists.
    responses:
      200:
        body:
          application/json:
            example: !include wishlists-example.json
  post:
    description: Check if the owner exists as a customer in the system, create a new wishlist, and send an e-mail to the customer.
    body:
      application/json:
        example: !include wishlist-example.json

  /{wishlistId}:
    type: element
    is: [yaasAware]
    uriParameters:
      wishlistId:
        description: The ID of the wishlist to work on.
        example: 784hti8ey
        type: string
    get:
      description: Get a wishlist.
      responses:
        200:
          body:
            application/json:
              example: !include wishlist-example.json

    put:
      description: Update a wishlist.
      body:
        application/json:
          example: !include wishlist-example.json

    delete:
      description: Delete a wishlist.

    /media:
      is: [yaasAware]
      post:
        body:
          multipart/form-data:
            formParameters:
                file:
                    description: |
                        Actual file content.
                    type: file
                    required: false
                    repeat: false
        responses:
          201:
            description: |
                The request succeeded and a new object was created.
            body:
                application/json:
                    schema: resourceLocation
          400:
            description: |
                Bad or incomplete request.
            body:
              application/json:
                  schema: errorMessage
      get:
        is: [ paged,countable ]
        responses:
          200:
            description: |
                The request succeeded and a new object was created.
            body:
              "application/json":
                  schema: wishlistMedias
                  example: !include wishlistMedias-example.json
          400:
            description: |
                Bad or incomplete request.
            body:
              "application/json":
                  schema: errorMessage
      /{mediaId}:
        is: [yaasAware]
        uriParameters:
          "mediaId":
            displayName: "mediaId"
            type: string
            required: true
            repeat: false
        delete:
          responses:
            204:
              description : |
                The resource has been successfully deleted.
            404:
                description: |
                    Media not found.
                body:
                    application/json:
                        schema: "errorMessage"
    /wishlistItems:
      type: collection
      is: [yaasAware]
      get:
        description: Gets all wishlist items
        is: [ paged ]
        responses:
          200:
            body:
              application/json:
      post:
        description: Adds a wishlist item
        body:
          application/json:
            example: !include wishlistItem-example.json
        responses:
          201:
            body:
              application/json:
                example: !include wishlistItem-example.json

#%RAML 0.8
title: Wishlist Service
baseUri: http://localhost/
version: v1
mediaType:  application/json

schemas:
  - error: !include https://api.yaas.io/patterns/v1/schema-error-message.json
  - documentMetaData: !include document/MetaData.json
  - documentPostResponse: !include document/POSTresponse.json
  - documentWishlist: !include document/Wishlist.json
  - documentWishlistItem: !include document/WishlistItem.json
  - documentWishlistItemRead: !include document/WishlistItemRead.json
  - documentWishlistRead: !include document/WishlistRead.json
  - documentWishlistMedia: !include document/WishlistMedia.json
  - documentWishlistMediaRead: !include document/WishlistMediaRead.json
  - resourceLocation: !include https://api.yaas.io/patterns/v1/schema-resource-location.json
  - customer: !include customer.json
  - wishlist: !include wishlist.json
  - wishlistItem: !include wishlistItem.json
  - wishlistItems: !include wishlistItems.json
  - wishlists: !include wishlists.json
  - wishlistMedia: !include wishlistMedia.json
  - wishlistMedias: !include wishlistMedias.json

traits:
  - !include https://api.yaas.io/patterns/v1/trait-yaas-aware.yaml
  - !include https://api.yaas.io/patterns/v2/trait-paged.yaml
  - !include https://api.yaas.io/patterns/v1/trait-countable.yaml

resourceTypes:
  - !include https://api.yaas.io/patterns/v1/resource-type-element.yaml
  - !include https://api.yaas.io/patterns/v1/resource-type-collection.yaml

/wishlists:
  type: collection
  is: [yaasAware]
  get:
    is: [paged,countable]
    description: Get all wishlists.
    responses:
      200:
        body:
          application/json:
            example: !include wishlists-example.json
  post:
    description: Check if the owner exists as a customer in the system, create a new wishlist, and send an e-mail to the customer.
    body:
      application/json:
        example: !include wishlist-example.json

  /{wishlistId}:
    type: element
    is: [yaasAware]
    uriParameters:
      wishlistId:
        description: The ID of the wishlist to work on.
        example: 784hti8ey
        type: string
    get:
      description: Get a wishlist.
      responses:
        200:
          body:
            application/json:
              example: !include wishlist-example.json

    put:
      description: Update a wishlist.
      body:
        application/json:
          example: !include wishlist-example.json

    delete:
      description: Delete a wishlist.

    /media:
      is: [yaasAware]
      post:
        body:
          multipart/form-data:
            formParameters:
                file:
                    description: |
                        Actual file content.
                    type: file
                    required: false
                    repeat: false
        responses:
          201:
            description: |
                The request succeeded and a new object was created.
            body:
                application/json:
                    schema: resourceLocation
          400:
            description: |
                Bad or incomplete request.
            body:
              application/json:
                  schema: errorMessage
      get:
        is: [ paged,countable ]
        responses:
          200:
            description: |
                The request succeeded and a new object was created.
            body:
              "application/json":
                  schema: wishlistMedias
                  example: !include wishlistMedias-example.json
          400:
            description: |
                Bad or incomplete request.
            body:
              "application/json":
                  schema: errorMessage
      /{mediaId}:
        is: [yaasAware]
        uriParameters:
          "mediaId":
            displayName: "mediaId"
            type: string
            required: true
            repeat: false
        delete:
          responses:
            204:
              description : |
                The resource has been successfully deleted.
            404:
                description: |
                    Media not found.
                body:
                    application/json:
                        schema: "errorMessage"
    /wishlistItems:
      type: collection
      is: [yaasAware]
      get:
        description: Gets all wishlist items
        is: [ paged ]
        responses:
          200:
            body:
              application/json:
      post:
        description: Adds a wishlist item
        body:
          application/json:
            example: !include wishlistItem-example.json
        responses:
          201:
            body:
              application/json:
                example: !include wishlistItem-example.json


change title

change title

small commits lmao

#%RAML 1.0
---
title: MyMICDS
version: v2
baseUri: http://localhost:1420
mediaType: application/json
securitySchemes:
  jwt: !include security/jwt.raml
securedBy: [ jwt ]

/auth:
  # TODO

/password:
  # TODO

/user:
  # TODO

#%RAML 1.0
---
title: MyMICDS API
version: v2
baseUri: http://localhost:1420
mediaType: application/json
securitySchemes:
  jwt: !include security/jwt.raml
securedBy: [ jwt ]

/auth:
  # TODO

/password:
  # TODO

/user:
  # TODO


Apparently I can't resolve merge conflicts.

#%RAML 0.8
title: Spotify Web API Demo
version: v1
protocols: [ HTTPS ]
baseUri: https://{subdomain}.spotify.com/{version}/{communityPath}
baseUriParameters:
  subdomain:
    description: subdomain of API
    default: api
uriParameters:
 communityPath:
   displayName: Community Path
   type: string
   pattern: ^[a-zA-Z0-9][-a-zA-Z0-9]*$
   minLength: 1
mediaType: application/json
documentation:
  - title: Spotify Web API Docs
    content: |
      Welcome to the _Spotify Web API_ demo specification. This is *not* the complete API
      specification, and is meant for testing purposes within this RAML specification.
      For more information about how to use the API, check out [developer
       site](https://developer.spotify.com/web-api/).
schemas:
  - Playlist: !include includes/post-playlist-schema.json
resourceTypes:
  - base:
      uriParameters:
        mediaTypeExtension:
          enum: [ .json ]
          description: Use .json to specify application/json media type.
      get?: &common
        headers:
          Accept:
            description: Is used to set specified media type.
            type: string
        body:
          application/json:
            schema: {"name": "string"}
            example: {"name": "Foo Bar"}
        responses:
          403:
            description: |
              API rate limit exceeded. See http://developer.spotify.com/web-api/#rate-limiting for details.
            headers:
              X-waiting-period:
                description: |
                  The number of seconds to wait before you can attempt to make a request again.
                type: integer
                required: true
                minimum: 1
                maximum: 3600
                example: 34
            body:
              application/json:
                schema: {"name": "string"}
                example: {"name": "Foo Bar"}
      post?: *common
  - collection:
      description: A description of the collection resource type
      post?:
        formParameters:
          ids:
            displayName: IDs
            description: A list of IDs
  - item:
      type: base
      get?:
        protocols: ["HTTP"]
        headers:
          X-another-header:
            description: Another header
  - queryParamType:
      get?:
        queryParameters:
          ids:
            displayName: Some sort of IDs
            type: string
            description: A comma-separated list of IDs
            required: true
  - formParamType:
      post?:
        formParameters:
          aFormParam:
            displayName: Some sort of Form Parameter
            type: string
            description: An uncreative form parameter
            required: true
  - baseUriType:
      get?:
        baseUriParameters:
          subdomain:
            description: subdomain for the baseUriType resource type
            default: fooBar
  - anotherExample:
      description: Another Resource Type example
      usage: Some sort of usage description
      mediaType: text/xml
      get:
        is: [ filterable ]
        securedBy: [ oauth_2_0 ]
  - inheritBaseExample:
      type: base
      usage: Some sort of usage text
      get?:
        displayName: inherited example
        body:
          application/x-www-form-urlencoded:
            formParameters:
              foo:
                displayName: Foo
                description: some foo bar
        responses:
          500:
            description: A 500 response
            headers:
              X-foo-bar:
                description: The foo bar header
                type: string
                required: true
                example: fuuuuuu
  - protocolExampleType:
      protocols: ["HTTP"]
      description: A resource type with a protocol definition
      get?:
        description: dummy method
  - parameterType:
      get:
        queryParameters:
          <<queryParamName>>:
            description: Return <<resourcePathName>> that have their <<queryParamName>> matching the given value
          <<fallbackParamName>>:
            description: If no values match the value given for <<queryParamName>>, use <<fallbackParamName>> instead
securitySchemes:
  - oauth_2_0:
      description: |
          Spotify supports OAuth 2.0 for authenticating all API requests.
      type: OAuth 2.0
      describedBy:
        headers:
          Authorization:
            description: |
              Used to send a valid OAuth 2 access token.
            type: string
        responses:
          401:
            description: |
              Bad or expired token. This can happen if the user revoked a token or
              the access token has expired. You should re-authenticate the user.
          403:
            description: |
              Bad OAuth request (wrong consumer key, bad nonce, expired
              timestamp...). Unfortunately, re-authenticating the user won't help here.
      settings:
        authorizationUri: https://accounts.spotify.com/authorize
        accessTokenUri: https://accounts.spotify.com/api/token
        authorizationGrants: [ code, token ]
        scopes:
          - "playlist-read-private"
          - "playlist-modify-public"
          - "playlist-modify-private"
          - "user-library-read"
          - "user-library-modify"
          - "user-read-private"
          - "user-read-email"
traits:
  - filterable:
      usage: Some description about using filterable
      queryParameters:
        fields:
          description: A comma-separated list of fields to filter query
          type: string
          example: tracks.items(added_by.id,track(name,href,album(name,href)))
          displayName: Fields
      headers:
        X-example-header:
          description: An example of a trait header
      body:
        application/json:
          schema: {"name": "string"}
          example: {"name": "example body for trait"}
      responses:
        200:
          description: Yay filterable!
  - paged:
      description: A description of the paged trait
      mediaType: application/xml
      uriParameters:
        limit:
          displayName: Limit
          description: The maximum number of track objects to return
          type: integer
          example: 10
          minimum: 0
          default: 20
          maximum: 50
        offset:
          displayName: Offset
          description: The index of the first track to return
          type: integer
          example: 5
          default: 0
  - formTrait:
      description: A description of a trait with form parameters
      mediaType: application/x-www-form-urlencoded
      formParameters:
        foo:
          displayName: Foo
          description: The Foo Form Field
          type: string
          minLength: 5
          maxLength: 50
          default: bar
  - baseUriTrait:
      description: A description of a trait with base URI parameters
      baseUriParameters:
        communityPath:
          displayName: Community Path trait
          description: The community path base URI trait
          type: string
          example: baz-community
  - protocolTrait:
      description: A trait to assign a protocol
      protocols: ["HTTP"]
  - parameterTrait:
      queryParameters:
        <<tokenName>>:
          description: A valid <<tokenName>> is required
/albums:
  displayName: several-albums
  get:
    description: |
      [Get Several Albums](https://developer.spotify.com/web-api/get-several-albums/)
    headers:
      X-bogus-header:
        description: just an extra header for funsies
    queryParameters:
      ids:
        displayName: Spotify Album IDs
        type: string
        description: A comma-separated list of IDs
        required: true
        example: "382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc"
  /{id}:
    displayName: album
    uriParameters:
      id:
        displayName: Spotify Album ID
        type: string
        description: The Spotify ID for the album
        example: 4aawyAB9vmqN3uQ7FjRGTy
    get:
      type: protocolExampleType
      description: |
        [Get an Album](https://developer.spotify.com/web-api/get-album/)
    /tracks:
      displayName: album-tracks
      type: baseUriType
      get:
        is: [ paged ]
        description: |
          [Get an Album's Tracks](https://developer.spotify.com/web-api/get-albums-tracks/)
/artists:
  displayName: several-artists
  get:
    description: |
      [Get Several Artists](https://developer.spotify.com/web-api/get-several-artists/)
    queryParameters:
      ids:
        displayName: Spotify Artist IDs
        type: string
        description: A comma-separated list of IDs
        required: true
        example: '2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6'
  /{id}:
    displayName: artist
    uriParameters:
      id:
        displayName: Spotify Artist ID
        type: string
        description: The Spotify ID for the artist
        example: 0TnOYISbd1XYRBk9myaseg
        required: true
    get:
      description: |
        [Get an Artist](https://developer.spotify.com/web-api/get-artist/)
    /top-tracks:
      displayName: artist-top-tracks
      get:
        description: |
          [Get an Artist's Top Tracks](https://developer.spotify.com/web-api/get-artists-top-tracks/)
        queryParameters:
          country:
            displayName: Country
            description: The country (an ISO 3166-1 alpha-2 country code)
            type: string
            example: ES
            required: true
    /related-artists:
      displayName: artist-related-artists
      get:
        description: |
          [Get an Artist's Related Artists](https://developer.spotify.com/web-api/get-related-artists/)
    /albums:
      displayName: artist-albums
      get:
        is: [ paged ]
        description: |
          [Get an Artist's Albums](https://developer.spotify.com/web-api/get-artists-albums/)
        queryParameters:
          album_type:
            displayName: Album Type
            description: Filter by album types
            type: string
            enum: ["single", "album", "appears_on", "compilation"]
            required: false
            example: album
          country:
            displayName: Country
            description: The country (an ISO 3166-1 alpha-2 country code)
            type: string
            example: ES
            required: false
/tracks:
  displayName: several-tracks
  get:
    description: |
      [Get Several Tracks](https://developer.spotify.com/web-api/get-several-tracks/)
    queryParameters:
      ids:
        displayName: Spotify Track IDs
        type: string
        description: A comma-separated list of IDs
        required: true
        example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
  /{id}:
    displayName: track
    type: baseUriType
    uriParameters:
      id:
        type: string
        displayName: Spotify Track ID
        example: 1zHlj4dQ8ZAtrayhuDDmkY
    get:
      description: |
        [Get a Track](https://developer.spotify.com/web-api/get-track/)
/search:
  displayName: search-item
  get:
    is: [ paged ]
    description: |
      [Search for an Item](https://developer.spotify.com/web-api/search-item/)
    queryParameters:
      q:
        displayName: Query
        type: string
        description: "The search query's keywords (and optional field filters). The search is not case-sensitive: 'roadhouse' will match 'Roadhouse', 'roadHouse', etc. Keywords will be matched in any order unless surrounded by quotes, thus q=roadhouse&20blues will match both 'Blues Roadhouse' and 'Roadhouse of the Blues'. Quotation marks can be used to limit the match to a phrase: q=roadhouse&20blues will match 'My Roadhouse Blues' but not 'Roadhouse of the Blues'. By default, results are returned when a match is found in any field of the target object type. Searches can be made more specific by specifying an album, artist or track field filter. For example q=album:gold%20artist:abba&type=album will search for albums with the text 'gold' in the album name and the text 'abba' in an artist name. Other possible field filters, depending on object types being searched, include year, genre, upc, and isrc. For example, q=damian%20genre:reggae-pop&type=artist. The asterisk (*) character can, with some limitations, be used as a wildcard (maximum: 2 per query). It will match a variable number of non-white-space characters. It cannot be used in a quoted phrase, in a field filter, or as the first character of the keyword string."
        example: Muse
        required: true
      type:
        displayName: Item Type
        description: A comma-separated list of item types to search across. Search results will include hits from all the specified item types; for example q=name:abacab&type=album,track will return both albums and tracks with "abacab" in their name.
        type: string
        example: artist
        enum: ["album", "artist", "track"]
        required: true
/me:
  displayName: current-user
  securedBy: [ oauth_2_0 ]
  type: queryParamType
  get:
    is: [ protocolTrait ]
    description: |
      [Get Current User's Profile](https://developer.spotify.com/web-api/get-current-users-profile/)
  /tracks:
    displayName: current-user-saved-tracks
    type: collection
    get:
      is: [ paged ]
      description: |
        [Get Current User's Saved Tracks](https://developer.spotify.com/web-api/get-users-saved-tracks/)
      securedBy: [ oauth_2_0: {scopes: ['user-library-read']}]
    put:
      description: |
        [Save Tracks for Current User](https://developer.spotify.com/web-api/save-tracks-user/)
      securedBy: [ oauth_2_0: {scopes: ['user-library-modify']}]
      protocols: ["HTTP"]
      queryParameters:
        ids:
          displayName: Spotify Track IDs
          type: string
          description: A comma-separated list of IDs
          required: true
          example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
    delete:
      description: |
        [Remove Tracks for Current User](https://developer.spotify.com/web-api/remove-tracks-user/)
      securedBy: [ oauth_2_0: {scopes: ['user-library-modify']}]
      queryParameters:
        ids:
          displayName: Spotify Track IDs
          type: string
          description: A comma-separated list of IDs
          required: true
          example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
    /contains:
      displayName: current-user-contains-saved-tracks
      get:
        description: |
          [Check Current User's Saved Tracks](https://developer.spotify.com/web-api/check-users-saved-tracks/)
        securedBy: [ oauth_2_0: {scopes: ['user-library-read']}]
        queryParameters:
          ids:
            displayName: Spotify Track IDs
            type: string
            description: A comma-separated list of IDs
            required: true
            example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
/users/{user_id}:
  baseUriParameters:
    subdomain:
      description: a test base URI parameter for resource-level
      default: barFoo
  displayName: users-profile
  protocols: [ "HTTP" ]
  uriParameters:
    user_id:
      displayName: User ID
      type: string
      description: The user's Spotify user ID.
      example: smedjan
  get:
    description: |
      [Get a User's Profile](https://developer.spotify.com/web-api/get-users-profile/)
/users/{user_id}/playlists:
  type: collection
  uriParameters:
    user_id:
      displayName: User ID
      type: string
      description: The user's Spotify user ID.
      example: smedjan
  displayName: playlists
  get:
    is: [ paged ]
    description: |
      [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/)
    securedBy: [ oauth_2_0: {scopes: ['playlist-read-private']}]
    responses:
      200:
        body:
          application/json:
            schema: |
              {
                "$schema": "http://json-schema.org/draft-03/schema",
                "type": "array",
                "items": {
                  "$ref": "schemas/playlist.json"
                }
              }
            #example: !include examples/playlists-get.json
  post:
    description: |
      [Create a Playlist](https://developer.spotify.com/web-api/create-playlist/)
    securedBy: [ oauth_2_0: {scopes: ['playlist-modify-public', 'playlist-modify-private']}]
    body:
      application/json:
        schema: !include includes/post-playlist-schema.json
        example: !include includes/post-playlist-example.json
    responses:
      201:
        headers:
          X-another-bogus-header:
            description: A bogus header
        body:
          application/json:
            schema: Playlist
  /{playlist_id}:
    type: item
    displayName: playlist
    uriParameters:
      playlist_id:
        displayName: Playlist ID
        description: The Spotify playlist ID.
        example: 3dEjWfgB5jC6zn6tLoy9yy
        type: string
        required: true
    get:
      description: |
        [Get a Playlist](https://developer.spotify.com/web-api/get-playlist/)
      securedBy: [ oauth_2_0: { scopes: ['playlist-read-private']}]
      is: [ filterable ]
      responses:
        200:
          body:
            application/json:
              schema: Playlist
    put:
      description: |
        [Change a Playlist's Details](https://developer.spotify.com/web-api/change-playlist-details/)
      securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
      body:
        application/json:
          schema: !include includes/post-playlist-schema.json
          example: !include includes/post-playlist-example.json
    /tracks:
      type: collection
      displayName: playlist-tracks
      get:
        description: |
          [Get a Playlist's Tracks](https://developer.spotify.com/web-api/get-playlists-tracks/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-read-private']}]
        is: [ filterable, paged ]
      post:
        description: |
          [Add Tracks to a Playlist](https://developer.spotify.com/web-api/add-tracks-to-playlist/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
        body:
          application/json:
      put:
        description: |
          [Replace a Playlist's tracks](https://developer.spotify.com/web-api/replace-playlists-tracks/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
        body:
          application/json:
      delete:
        description: |
          [Remove Tracks from a Playlist](https://developer.spotify.com/web-api/remove-tracks-playlist/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
        body:
          application/json:
/form_parameters:
  description: A example resource with form parameters
  displayName: formParamResource
  post:
    formParameters:
      foo:
        description: Post some foo
        type: string
        required: true
        minLength: 10
        maxLength: 100
      bar:
        description: Post some bar
        type: string
        required: false
        minLength: 15
        maxLength: 150
        default: aPostedBarExample
/no_method_properties:
  /child:
    description: Child of "/no_method_properties"
    get:

#%RAML 0.8
title: Spotify Web API Demo
version: v1
protocols: [ HTTPS ]
baseUri: https://{subdomain}.spotify.com/{version}/{communityPath}
baseUriParameters:
  subdomain:
    description: subdomain of API
    default: api
uriParameters:
 communityPath:
   displayName: Community Path
   type: string
   pattern: ^[a-zA-Z0-9][-a-zA-Z0-9]*$
   minLength: 1
mediaType: application/json
documentation:
  - title: Spotify Web API Docs
    content: |
      Welcome to the _Spotify Web API_ demo specification. This is *not* the complete API
      specification, and is meant for testing purposes within this RAML specification.
      For more information about how to use the API, check out [developer
       site](https://developer.spotify.com/web-api/).
schemas:
  - Playlist: !include includes/post-playlist-schema.json
resourceTypes:
  - base:
      uriParameters:
        mediaTypeExtension:
          enum: [ .json ]
          description: Use .json to specify application/json media type.
      get?: &common
        headers:
          Accept:
            description: Is used to set specified media type.
            type: string
        body:
          application/json:
            schema: {"name": "string"}
            example: {"name": "Foo Bar"}
        responses:
          403:
            description: |
              API rate limit exceeded. See http://developer.spotify.com/web-api/#rate-limiting for details.
            headers:
              X-waiting-period:
                description: |
                  The number of seconds to wait before you can attempt to make a request again.
                type: integer
                required: true
                minimum: 1
                maximum: 3600
                example: 34
            body:
              application/json:
                schema: {"name": "string"}
                example: {"name": "Foo Bar"}
      post?: *common
  - collection:
      description: A description of the collection resource type
      post?:
        formParameters:
          ids:
            displayName: IDs
            description: A list of IDs
  - item:
      type: base
      get?:
        protocols: ["HTTP"]
        headers:
          X-another-header:
            description: Another header
  - queryParamType:
      get?:
        queryParameters:
          ids:
            displayName: Some sort of IDs
            type: string
            description: A comma-separated list of IDs
            required: true
  - formParamType:
      post?:
        formParameters:
          aFormParam:
            displayName: Some sort of Form Parameter
            type: string
            description: An uncreative form parameter
            required: true
  - baseUriType:
      get?:
        baseUriParameters:
          subdomain:
            description: subdomain for the baseUriType resource type
            default: fooBar
  - anotherExample:
      description: Another Resource Type example
      usage: Some sort of usage description
      mediaType: text/xml
      get:
        is: [ filterable ]
        securedBy: [ oauth_2_0 ]
  - inheritBaseExample:
      type: base
      usage: Some sort of usage text
      get?:
        displayName: inherited example
        body:
          application/x-www-form-urlencoded:
            formParameters:
              foo:
                displayName: Foo
                description: some foo bar
        responses:
          500:
            description: A 500 response
            headers:
              X-foo-bar:
                description: The foo bar header
                type: string
                required: true
                example: fuuuuuu
  - protocolExampleType:
      protocols: ["HTTP"]
      description: A resource type with a protocol definition
      get?:
        description: dummy method
  - parameterType:
      get:
        queryParameters:
          <<queryParamName>>:
            description: Return <<resourcePathName>> that have their <<queryParamName>> matching the given value
          <<fallbackParamName>>:
            description: If no values match the value given for <<queryParamName>>, use <<fallbackParamName>> instead
securitySchemes:
  - oauth_2_0:
      description: |
          Spotify supports OAuth 2.0 for authenticating all API requests.
      type: OAuth 2.0
      describedBy:
        headers:
          Authorization:
            description: |
              Used to send a valid OAuth 2 access token.
            type: string
        responses:
          401:
            description: |
              Bad or expired token. This can happen if the user revoked a token or
              the access token has expired. You should re-authenticate the user.
          403:
            description: |
              Bad OAuth request (wrong consumer key, bad nonce, expired
              timestamp...). Unfortunately, re-authenticating the user won't help here.
      settings:
        authorizationUri: https://accounts.spotify.com/authorize
        accessTokenUri: https://accounts.spotify.com/api/token
        authorizationGrants: [ code, token ]
        scopes:
          - "playlist-read-private"
          - "playlist-modify-public"
          - "playlist-modify-private"
          - "user-library-read"
          - "user-library-modify"
          - "user-read-private"
          - "user-read-email"
traits:
  - filterable:
      usage: Some description about using filterable
      queryParameters:
        fields:
          description: A comma-separated list of fields to filter query
          type: string
          example: tracks.items(added_by.id,track(name,href,album(name,href)))
          displayName: Fields
      headers:
        X-example-header:
          description: An example of a trait header
      body:
        application/json:
          schema: {"name": "string"}
          example: {"name": "example body for trait"}
      responses:
        200:
          description: Yay filterable!
  - paged:
      description: A description of the paged trait
      mediaType: application/xml
      uriParameters:
        limit:
          displayName: Limit
          description: The maximum number of track objects to return
          type: integer
          example: 10
          minimum: 0
          default: 20
          maximum: 50
        offset:
          displayName: Offset
          description: The index of the first track to return
          type: integer
          example: 5
          default: 0
  - formTrait:
      description: A description of a trait with form parameters
      mediaType: application/x-www-form-urlencoded
      formParameters:
        foo:
          displayName: Foo
          description: The Foo Form Field
          type: string
          minLength: 5
          maxLength: 50
          default: bar
  - baseUriTrait:
      description: A description of a trait with base URI parameters
      baseUriParameters:
        communityPath:
          displayName: Community Path trait
          description: The community path base URI trait
          type: string
          example: baz-community
  - protocolTrait:
      description: A trait to assign a protocol
      protocols: ["HTTP"]
  - parameterTrait:
      queryParameters:
        <<tokenName>>:
          description: A valid <<tokenName>> is required
/albums:
  displayName: several-albums
  get:
    description: |
      [Get Several Albums](https://developer.spotify.com/web-api/get-several-albums/)
    headers:
      X-bogus-header:
        description: just an extra header for funsies
    queryParameters:
      ids:
        displayName: Spotify Album IDs
        type: string
        description: A comma-separated list of IDs
        required: true
        example: "382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc"
  /{id}:
    displayName: album
    uriParameters:
      id:
        displayName: Spotify Album ID
        type: string
        description: The Spotify ID for the album
        example: 4aawyAB9vmqN3uQ7FjRGTy
    get:
      type: protocolExampleType
      description: |
        [Get an Album](https://developer.spotify.com/web-api/get-album/)
    /tracks:
      displayName: album-tracks
      type: baseUriType
      get:
        is: [ paged ]
        description: |
          [Get an Album's Tracks](https://developer.spotify.com/web-api/get-albums-tracks/)
/artists:
  displayName: several-artists
  get:
    description: |
      [Get Several Artists](https://developer.spotify.com/web-api/get-several-artists/)
    queryParameters:
      ids:
        displayName: Spotify Artist IDs
        type: string
        description: A comma-separated list of IDs
        required: true
        example: '2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6'
  /{id}:
    displayName: artist
    uriParameters:
      id:
        displayName: Spotify Artist ID
        type: string
        description: The Spotify ID for the artist
        example: 0TnOYISbd1XYRBk9myaseg
        required: true
    get:
      description: |
        [Get an Artist](https://developer.spotify.com/web-api/get-artist/)
    /top-tracks:
      displayName: artist-top-tracks
      get:
        description: |
          [Get an Artist's Top Tracks](https://developer.spotify.com/web-api/get-artists-top-tracks/)
        queryParameters:
          country:
            displayName: Country
            description: The country (an ISO 3166-1 alpha-2 country code)
            type: string
            example: ES
            required: true
    /related-artists:
      displayName: artist-related-artists
      get:
        description: |
          [Get an Artist's Related Artists](https://developer.spotify.com/web-api/get-related-artists/)
    /albums:
      displayName: artist-albums
      get:
        is: [ paged ]
        description: |
          [Get an Artist's Albums](https://developer.spotify.com/web-api/get-artists-albums/)
        queryParameters:
          album_type:
            displayName: Album Type
            description: Filter by album types
            type: string
            enum: ["single", "album", "appears_on", "compilation"]
            required: false
            example: album
          country:
            displayName: Country
            description: The country (an ISO 3166-1 alpha-2 country code)
            type: string
            example: ES
            required: false
/tracks:
  displayName: several-tracks
  get:
    description: |
      [Get Several Tracks](https://developer.spotify.com/web-api/get-several-tracks/)
    queryParameters:
      ids:
        displayName: Spotify Track IDs
        type: string
        description: A comma-separated list of IDs
        required: true
        example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
  /{id}:
    displayName: track
    type: baseUriType
    uriParameters:
      id:
        type: string
        displayName: Spotify Track ID
        example: 1zHlj4dQ8ZAtrayhuDDmkY
    get:
      description: |
        [Get a Track](https://developer.spotify.com/web-api/get-track/)
/search:
  displayName: search-item
  get:
    is: [ paged ]
    description: |
      [Search for an Item](https://developer.spotify.com/web-api/search-item/)
    queryParameters:
      q:
        displayName: Query
        type: string
        description: "The search query's keywords (and optional field filters). The search is not case-sensitive: 'roadhouse' will match 'Roadhouse', 'roadHouse', etc. Keywords will be matched in any order unless surrounded by quotes, thus q=roadhouse&20blues will match both 'Blues Roadhouse' and 'Roadhouse of the Blues'. Quotation marks can be used to limit the match to a phrase: q=roadhouse&20blues will match 'My Roadhouse Blues' but not 'Roadhouse of the Blues'. By default, results are returned when a match is found in any field of the target object type. Searches can be made more specific by specifying an album, artist or track field filter. For example q=album:gold%20artist:abba&type=album will search for albums with the text 'gold' in the album name and the text 'abba' in an artist name. Other possible field filters, depending on object types being searched, include year, genre, upc, and isrc. For example, q=damian%20genre:reggae-pop&type=artist. The asterisk (*) character can, with some limitations, be used as a wildcard (maximum: 2 per query). It will match a variable number of non-white-space characters. It cannot be used in a quoted phrase, in a field filter, or as the first character of the keyword string."
        example: Muse
        required: true
      type:
        displayName: Item Type
        description: A comma-separated list of item types to search across. Search results will include hits from all the specified item types; for example q=name:abacab&type=album,track will return both albums and tracks with "abacab" in their name.
        type: string
        example: artist
        enum: ["album", "artist", "track"]
        required: true
/me:
  displayName: current-user
  securedBy: [ oauth_2_0 ]
  type: queryParamType
  get:
    is: [ protocolTrait ]
    description: |
      [Get Current User's Profile](https://developer.spotify.com/web-api/get-current-users-profile/)
  /tracks:
    displayName: current-user-saved-tracks
    type: collection
    get:
      is: [ paged ]
      description: |
        [Get Current User's Saved Tracks](https://developer.spotify.com/web-api/get-users-saved-tracks/)
      securedBy: [ oauth_2_0: {scopes: ['user-library-read']}]
    put:
      description: |
        [Save Tracks for Current User](https://developer.spotify.com/web-api/save-tracks-user/)
      securedBy: [ oauth_2_0: {scopes: ['user-library-modify']}]
      protocols: ["HTTP"]
      queryParameters:
        ids:
          displayName: Spotify Track IDs
          type: string
          description: A comma-separated list of IDs
          required: true
          example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
    delete:
      description: |
        [Remove Tracks for Current User](https://developer.spotify.com/web-api/remove-tracks-user/)
      securedBy: [ oauth_2_0: {scopes: ['user-library-modify']}]
      queryParameters:
        ids:
          displayName: Spotify Track IDs
          type: string
          description: A comma-separated list of IDs
          required: true
          example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
    /contains:
      displayName: current-user-contains-saved-tracks
      get:
        description: |
          [Check Current User's Saved Tracks](https://developer.spotify.com/web-api/check-users-saved-tracks/)
        securedBy: [ oauth_2_0: {scopes: ['user-library-read']}]
        queryParameters:
          ids:
            displayName: Spotify Track IDs
            type: string
            description: A comma-separated list of IDs
            required: true
            example: '7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B'
/users/{user_id}:
  baseUriParameters:
    subdomain:
      description: a test base URI parameter for resource-level
      default: barFoo
  displayName: users-profile
  protocols: [ "HTTP" ]
  uriParameters:
    user_id:
      displayName: User ID
      type: string
      description: The user's Spotify user ID.
      example: smedjan
  get:
    description: |
      [Get a User's Profile](https://developer.spotify.com/web-api/get-users-profile/)
/users/{user_id}/playlists:
  type: collection
  uriParameters:
    user_id:
      displayName: User ID
      type: string
      description: The user's Spotify user ID.
      example: smedjan
  displayName: playlists
  get:
    is: [ paged ]
    description: |
      [Get a List of a User's Playlists](https://developer.spotify.com/web-api/get-list-users-playlists/)
    securedBy: [ oauth_2_0: {scopes: ['playlist-read-private']}]
    responses:
      200:
        body:
          application/json:
            schema: |
              {
                "$schema": "http://json-schema.org/draft-03/schema",
                "type": "array",
                "items": {
                  "$ref": "schemas/playlist.json"
                }
              }
            #example: !include examples/playlists-get.json
  post:
    description: |
      [Create a Playlist](https://developer.spotify.com/web-api/create-playlist/)
    securedBy: [ oauth_2_0: {scopes: ['playlist-modify-public', 'playlist-modify-private']}]
    body:
      application/json:
        schema: !include includes/post-playlist-schema.json
        example: !include includes/post-playlist-example.json
    responses:
      201:
        headers:
          X-another-bogus-header:
            description: A bogus header
        body:
          application/json:
            schema: Playlist
  /{playlist_id}:
    type: item
    displayName: playlist
    uriParameters:
      playlist_id:
        displayName: Playlist ID
        description: The Spotify playlist ID.
        example: 3dEjWfgB5jC6zn6tLoy9yy
        type: string
        required: true
    get:
      description: |
        [Get a Playlist](https://developer.spotify.com/web-api/get-playlist/)
      securedBy: [ oauth_2_0: { scopes: ['playlist-read-private']}]
      is: [ filterable ]
      responses:
        200:
          body:
            application/json:
              schema: Playlist
    put:
      description: |
        [Change a Playlist's Details](https://developer.spotify.com/web-api/change-playlist-details/)
      securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
      body:
        application/json:
          schema: !include includes/post-playlist-schema.json
          example: !include includes/post-playlist-example.json
    /tracks:
      type: collection
      displayName: playlist-tracks
      get:
        description: |
          [Get a Playlist's Tracks](https://developer.spotify.com/web-api/get-playlists-tracks/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-read-private']}]
        is: [ filterable, paged ]
      post:
        description: |
          [Add Tracks to a Playlist](https://developer.spotify.com/web-api/add-tracks-to-playlist/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
        body:
          application/json:
      put:
        description: |
          [Replace a Playlist's tracks](https://developer.spotify.com/web-api/replace-playlists-tracks/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
        body:
          application/json:
      delete:
        description: |
          [Remove Tracks from a Playlist](https://developer.spotify.com/web-api/remove-tracks-playlist/)
        securedBy: [ oauth_2_0: { scopes: ['playlist-modify-public', 'playlist-modify-private']}]
        body:
          application/json:
/fill_param_example:
  description: An example that fills in parameter names in types and traits
  displayName: fillParamExample
  type: { parameterType: { queryParamName: foo, fallbackParamName: bar } }
  get:
    is: [ parameterTrait: { tokenName: access_token} ]
/form_parameters:
  description: A example resource with form parameters
  displayName: formParamResource
  post:
    formParameters:
      foo:
        description: Post some foo
        type: string
        required: true
        minLength: 10
        maxLength: 100
      bar:
        description: Post some bar
        type: string
        required: false
        minLength: 15
        maxLength: 150
        default: aPostedBarExample
/no_method_properties:
  /child:
    description: Child of "/no_method_properties"
    get: