Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support storing links info at interface level #20

Open
zebapy opened this issue May 11, 2022 · 0 comments
Open

support storing links info at interface level #20

zebapy opened this issue May 11, 2022 · 0 comments

Comments

@zebapy
Copy link
Member

zebapy commented May 11, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant