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

Allow Links to Schema objects (Primitives/Objects/...) #3228

Closed
ochatelain opened this issue Apr 4, 2023 · 1 comment
Closed

Allow Links to Schema objects (Primitives/Objects/...) #3228

ochatelain opened this issue Apr 4, 2023 · 1 comment
Labels
links Moved to Moonwalk Issues that can be closed or migrated as being addressed in Moonwalk schema-object

Comments

@ochatelain
Copy link

Situation:

  • Links to operation could start from data-types rather than from other operations

Example:

Link from Type (UserId)

components:
  schemas:
    UserId:
      type: integer
      format: int64
      example: 10
      # -----------------------------------------------------
      # Links
      # -----------------------------------------------------
      links:
        GetUserByUserId: # <---- arbitrary name for the link
        operationId: getUser
        parameters:
          userId: '/'
        description: >
          Anyx `UserId` field can be used as parameter for
          the `userId` parameter in `GET /users/{userId}`.

Links from Object (User)

      # -----------------------------------------------------
      # Links
      # -----------------------------------------------------
      links:
        GetUserByUserId: # <---- arbitrary name for the link
        operationId: getUser
        parameters:
          userId: '$id'
        description: >
          The `id` value of Users can be used as parameter for
          the `userId` parameter in `GET /users/{userId}`.
components:
  schemas:
    User:
      x-swagger-router-model: io.swagger.petstore.model.User
      properties:
        id:
          type: integer
          format: int64
          example: 10
        username:
          type: string
          example: theUser
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: James
        email:
          type: string
          example: [email protected]
        password:
          type: string
          example: 12345
        phone:
          type: string
          example: 12345
        userStatus:
          type: integer
          format: int32
          example: 1
          description: User Status
      xml:
        name: user
      type: object
      # -----------------------------------------------------
      # Links
      # -----------------------------------------------------
      links:
        GetUserByUserId: # <---- arbitrary name for the link
        operationId: getUser
        parameters:
          userId: '/id'
        description: >
          The `id` value of Users can be used as parameter for
          the `userId` parameter in `GET /users/{userId}`.
@handrews
Copy link
Member

This scale of change is best discussed in Moonwalk (and can be backported if relevant and we decide to keep the 3.x line going). Closing in favor of:

@handrews handrews added the Moved to Moonwalk Issues that can be closed or migrated as being addressed in Moonwalk label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
links Moved to Moonwalk Issues that can be closed or migrated as being addressed in Moonwalk schema-object
Projects
None yet
Development

No branches or pull requests

2 participants