Skip to content

support storing links info at interface level #20

@zebapy

Description

@zebapy

moving from code comment https://github.com/faradayio/sdk_docs/pull/25/files#r870373284

To support managing https://swagger.io/docs/specification/links/ sanely, we should add a feature to openapi-interfaces that will allow us to store the link resolution info at the content definition type (interface?) and populate it at any paths that given interface is resolved

interfaces:
    Scope:
      $includes: "Resource"
      description: Instructions on how to produce output data.
      members:
        resource_type:
          schema:
            example: scopes
        id:
          schema:
            example: 8e63467d-9478-4fba-b05a-d5e98fd06d12
        preview:
          required: false
          mutable: true
          schema:
            type: boolean
            example: true
            description: |
              A preview scope provides only a limited number of output records, but
              it is not billed.
        population:
          required: true
          initializable: true
          mutable: true
          schema:
            $interface: "ScopePopulation#SameAsInterface"
        payload:
          required: true
          initializable: true
          schema:
            $interface: "ScopePayload#SameAsInterface"
      # We would love to be able to do this but we need to figure out the details
      # links:
      #   population_cohorts:
      #     operationId: getScopePopulationCohorts
      #     parameters:
      #       scope_id: "#/id"

We should then auto populate the links info anywhere a Scope is resolved

  /scopes/{scope_id}:
    get:
      tags:
        - scopes
      summary: Retrieve a scope
      description: Get details on a specific scope
      operationId: getScope
      parameters:
        - name: scope_id
          in: path
          description: The UUID of a scope
          required: true
          schema:
            type: string
            format: uuid
      responses:
        200:
          description: Information about the scope
          content:
            application/json:
              schema:
                $interface: "Scope"
          links: # openapi-interfaces should set links here
            populationCohorts:
              operationId: getScopePopulationCohorts
              parameters:
                scope_id: $response.body#/id
            populationExclusionCohorts:
              operationId: getScopePopulationExclusionCohorts
              parameters:
                scope_id: $response.body#/id
            payloadOutcomes:
              operationId: getScopePayloadOutcomes
              parameters:
                scope_id: $response.body#/id
            payloadPersonaSets:
              operationId: getScopePayloadPersonaSets
              parameters:
                scope_id: $response.body#/id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions