Microsoft Power Automate · API Governance Rules

Microsoft Power Automate API Rules

Spectral linting rules defining API design standards and conventions for Microsoft Power Automate.

28 Rules error 15 warn 11 info 2
View Rules File View on GitHub

Rule Categories

delete error get info no openapi operation parameter paths response schema security servers

Rules

error
info-title-required
Info object must have a title
$.info
warn
info-title-prefix
Info title should start with Microsoft Power Automate
$.info.title
error
info-description-required
Info object must have a description
$.info
error
info-version-required
Info object must have a version
$.info
error
openapi-version
OpenAPI version must be 3.0.x
$
error
servers-defined
Servers array must be defined
$
error
servers-https
Server URLs must use HTTPS
$.servers[*].url
error
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths
error
operation-summary-required
Operations must have a summary
$.paths[*][get,post,put,patch,delete]
error
operation-description-required
Operations must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-required
Operations must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camel-case
operationId should be camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
info
operation-summary-prefix
Operation summaries should start with Microsoft Power Automate
$.paths[*][get,post,put,patch,delete].summary
warn
parameter-description-required
Parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameter-schema-required
Parameters must have a schema
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-success-required
Operations must define a success response
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-required
Operations should define a 401 response
$.paths[*][get,post,put,patch,delete].responses
warn
schema-description-required
Schemas should have descriptions
$.components.schemas[*]
error
security-global-defined
Global security must be defined
$
error
security-schemes-defined
Security schemes must be defined
$.components
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body
$.paths[*].delete
warn
servers-expected-domain
Server URLs should be on the microsoft.com domain.
$.servers[*].url
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (Error) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# microsoft-power-automate — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - servers-https-only: 100% of servers already https (error)
#   - servers-expected-domain: 1/1 servers on microsoft.com
#   - path-params-casing: camel @ 100% (n=33)
#   - operationid-casing: camel @ 100% (n=18)
#   - schema-names-casing: pascal @ 100% (n=25)
#   - schema-properties-casing: snake @ 61% (n=71)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: Error
#   - operation-documents-401: 100% adherence
#   - merge: kept 23 existing, added 5 measured, upgraded 0
#   - added: servers-expected-domain, schema-names-casing, schema-properties-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-required:
    description: Info object must have a title
    given: $.info
    severity: error
    then:
      field: title
      function: truthy
  info-title-prefix:
    description: Info title should start with Microsoft Power Automate
    given: $.info.title
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ^Microsoft Power Automate
  info-description-required:
    description: Info object must have a description
    given: $.info
    severity: error
    then:
      field: description
      function: truthy
  info-version-required:
    description: Info object must have a version
    given: $.info
    severity: error
    then:
      field: version
      function: truthy
  openapi-version:
    description: OpenAPI version must be 3.0.x
    given: $
    severity: error
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.0
  servers-defined:
    description: Servers array must be defined
    given: $
    severity: error
    then:
      field: servers
      function: truthy
  servers-https:
    description: Server URLs must use HTTPS
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: ^https://
  paths-no-trailing-slash:
    description: Paths must not have trailing slashes
    given: $.paths
    severity: error
    then:
      field: '@key'
      function: pattern
      functionOptions:
        notMatch: /$
  operation-summary-required:
    description: Operations must have a summary
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: summary
      function: truthy
  operation-description-required:
    description: Operations must have a description
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: description
      function: truthy
  operation-operationid-required:
    description: Operations must have an operationId
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: operationId
      function: truthy
  operation-operationid-camel-case:
    description: operationId should be camelCase
    given: $.paths[*][get,post,put,patch,delete].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  operation-tags-required:
    description: Operations must have at least one tag
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: tags
      function: truthy
  operation-summary-prefix:
    description: Operation summaries should start with Microsoft Power Automate
    given: $.paths[*][get,post,put,patch,delete].summary
    severity: info
    then:
      function: pattern
      functionOptions:
        match: '^Microsoft Power Automate '
  parameter-description-required:
    description: Parameters must have descriptions
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    severity: warn
    then:
      field: description
      function: truthy
  parameter-schema-required:
    description: Parameters must have a schema
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    severity: error
    then:
      field: schema
      function: truthy
  response-success-required:
    description: Operations must define a success response
    given: $.paths[*][get,post,put,patch,delete].responses
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
          - required:
            - '202'
          - required:
            - '204'
  response-401-required:
    description: Operations should define a 401 response
    given: $.paths[*][get,post,put,patch,delete].responses
    severity: warn
    then:
      field: '401'
      function: truthy
  schema-description-required:
    description: Schemas should have descriptions
    given: $.components.schemas[*]
    severity: warn
    then:
      field: description
      function: truthy
  security-global-defined:
    description: Global security must be defined
    given: $
    severity: error
    then:
      field: security
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined
    given: $.components
    severity: error
    then:
      field: securitySchemes
      function: truthy
  get-no-request-body:
    description: GET operations must not have a request body
    given: $.paths[*].get
    severity: error
    then:
      field: requestBody
      function: falsy
  delete-no-request-body:
    description: DELETE operations should not have a request body
    given: $.paths[*].delete
    severity: warn
    then:
      field: requestBody
      function: falsy
  servers-expected-domain:
    description: Server URLs should be on the microsoft.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: microsoft\.com
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  error-schema-defined:
    description: A shared error schema (Error) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: Error
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy