Skip to content
This repository was archived by the owner on Feb 17, 2024. It is now read-only.
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

The spec must be clear about emty array values. #652

@KonstantinSviridov

Description

@KonstantinSviridov

The complete list of properties which accept arrays as values is

  • Api.protocols
  • Api.mediaType
  • Api.documentation
  • Api.securedBy
  • Resource.securedBy
  • Resource.is
  • ResourceType.is
  • Method.securedBy
  • Method.is
  • TypeDeclaration.enum
  • TypeDeclaration.type
  • AnnotationTypeDeclaration.allowedTargets
  • OAuth1SecuritySchemeSettings.signatures
  • OAuth2SecuritySchemeSettings.scopes

The spec clearly prohibits empty arrays for Api.protocols, Api.documentation and AnnotationTypeDeclaration.allowedTargets.

As for securedBy, the spec states:

The value assigned to the securedBy node MUST be a list of any of the security schemes previously defined in the securitySchemes node of RAML document root.

This sentence can be understood as allowing empty arrays for securedBy. Is it really so?

Finally, the spec says nothing about empty arrays for the remaining properties:

  • Api.mediaType
  • Resource.is
  • ResourceType.is
  • Method.is
  • TypeDeclaration.enum
  • TypeDeclaration.type
  • OAuth1SecuritySchemeSettings.signatures
  • OAuth2SecuritySchemeSettings.scopes

The TypeDeclaration.type case looks very confusing as it is in fact a case of multiple inheritance where a number of inherited types is zero. So, I would prohibit it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions