Amazon FSx · API Governance Rules

Amazon FSx API Rules

Spectral linting rules defining API design standards and conventions for Amazon FSx.

26 Rules error 7 warn 16 info 3
View Rules File View on GitHub

Rule Categories

fsx

Rules

warn
fsx-info-contact
API must include contact information
$.info
error
fsx-info-description
API must have a description
$.info
error
fsx-server-https
Server URLs must use HTTPS
$.servers[*].url
error
fsx-operation-summary
Operations must have a summary
$.paths[*][get,post,put,patch,delete]
warn
fsx-operation-description
Operations should have a description
$.paths[*][get,post,put,patch,delete]
error
fsx-operation-tags
Operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
error
fsx-operation-id
Operations must have operationId
$.paths[*][get,post,put,patch,delete]
warn
fsx-operation-id-camel-case
operationId should use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
fsx-response-200
POST operations should define 200 response
$.paths[*][post]
warn
fsx-response-400
Operations should define 400 response
$.paths[*][get,post,put,patch,delete]
warn
fsx-response-500
Operations should define 500 response
$.paths[*][get,post,put,patch,delete]
warn
fsx-schema-description
Schema components should have descriptions
$.components.schemas[*]
warn
fsx-tags-title-case
Operation tags should use Title Case
$.paths[*][*].tags[*]
warn
fsx-filesystem-type-documented
FileSystem schema should define FileSystemType field
$.components.schemas.FileSystem.properties
info
fsx-lifecycle-enum
FileSystem lifecycle should define enum values
$.components.schemas.FileSystem.properties.Lifecycle
info
fsx-backup-type-enum
Backup type should define enum values
$.components.schemas.Backup.properties.Type
error
fsx-parameter-description
Parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
fsx-path-param-required
Path parameters must be required
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='path')]
warn
fsx-schema-properties
Object schemas should define properties
$.components.schemas[?(@.type=='object')]
warn
fsx-request-body-json
POST request bodies should define application/json content
$.paths[*].post.requestBody.content
warn
fsx-create-prefix
POST creation operationIds should start with 'create'
$.paths[*].post.operationId
warn
fsx-delete-operation
DELETE operations should have a description
$.paths[*].delete
warn
fsx-storage-capacity-documented
FileSystem schema should document StorageCapacity
$.components.schemas.FileSystem.properties
info
fsx-resource-arn-consistent
Resource ARN field should be named ResourceARN
$.components.schemas[*].properties.ResourceARN
warn
fsx-tag-schema-required
Tag schema must require Key field
$.components.schemas.Tag.required
warn
fsx-svm-filesystem-required
StorageVirtualMachine must reference FileSystemId
$.components.schemas.StorageVirtualMachine.required

Spectral Ruleset

Raw ↑
# Amazon FSx Spectral Rules
extends: spectral:oas
rules:
  fsx-info-contact:
    description: API must include contact information
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy
  fsx-info-description:
    description: API must have a description
    severity: error
    given: "$.info"
    then:
      field: description
      function: truthy
  fsx-server-https:
    description: Server URLs must use HTTPS
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  fsx-operation-summary:
    description: Operations must have a summary
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy
  fsx-operation-description:
    description: Operations should have a description
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy
  fsx-operation-tags:
    description: Operations must have at least one tag
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy
  fsx-operation-id:
    description: Operations must have operationId
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy
  fsx-operation-id-camel-case:
    description: operationId should use camelCase
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"
  fsx-response-200:
    description: POST operations should define 200 response
    severity: warn
    given: "$.paths[*][post]"
    then:
      field: responses.200
      function: truthy
  fsx-response-400:
    description: Operations should define 400 response
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: responses.400
      function: truthy
  fsx-response-500:
    description: Operations should define 500 response
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: responses.500
      function: truthy
  fsx-schema-description:
    description: Schema components should have descriptions
    severity: warn
    given: "$.components.schemas[*]"
    then:
      field: description
      function: truthy
  fsx-tags-title-case:
    description: Operation tags should use Title Case
    severity: warn
    given: "$.paths[*][*].tags[*]"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 ]*$"
  fsx-filesystem-type-documented:
    description: FileSystem schema should define FileSystemType field
    severity: warn
    given: "$.components.schemas.FileSystem.properties"
    then:
      field: FileSystemType
      function: truthy
  fsx-lifecycle-enum:
    description: FileSystem lifecycle should define enum values
    severity: info
    given: "$.components.schemas.FileSystem.properties.Lifecycle"
    then:
      field: enum
      function: truthy
  fsx-backup-type-enum:
    description: Backup type should define enum values
    severity: info
    given: "$.components.schemas.Backup.properties.Type"
    then:
      field: enum
      function: truthy
  fsx-parameter-description:
    description: Parameters must have descriptions
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: description
      function: truthy
  fsx-path-param-required:
    description: Path parameters must be required
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='path')]"
    then:
      field: required
      function: truthy
  fsx-schema-properties:
    description: Object schemas should define properties
    severity: warn
    given: "$.components.schemas[?(@.type=='object')]"
    then:
      field: properties
      function: truthy
  fsx-request-body-json:
    description: POST request bodies should define application/json content
    severity: warn
    given: "$.paths[*].post.requestBody.content"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required: ["application/json"]
  fsx-create-prefix:
    description: POST creation operationIds should start with 'create'
    severity: warn
    given: "$.paths[*].post.operationId"
    then:
      function: pattern
      functionOptions:
        match: "^(create|describe|list|tag|associate)"
  fsx-delete-operation:
    description: DELETE operations should have a description
    severity: warn
    given: "$.paths[*].delete"
    then:
      field: description
      function: truthy
  fsx-storage-capacity-documented:
    description: FileSystem schema should document StorageCapacity
    severity: warn
    given: "$.components.schemas.FileSystem.properties"
    then:
      field: StorageCapacity
      function: truthy
  fsx-resource-arn-consistent:
    description: Resource ARN field should be named ResourceARN
    severity: info
    given: "$.components.schemas[*].properties.ResourceARN"
    then:
      field: type
      function: truthy
  fsx-tag-schema-required:
    description: Tag schema must require Key field
    severity: warn
    given: "$.components.schemas.Tag.required"
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            const: Key
  fsx-svm-filesystem-required:
    description: StorageVirtualMachine must reference FileSystemId
    severity: warn
    given: "$.components.schemas.StorageVirtualMachine.required"
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            const: FileSystemId