You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been following line by line official tutorial about OAS 3.0 Links (https://swagger.io/docs/specification/links/), but it seems to me that "runtime expressions" feature is not implemented yet. Runtime expressions are not updating values or creating links dynamically when I made request to server with implemented logic.
OpenAPI definition
openapi: 3.0.0
info:
version: 0.0.1
title: Links example
servers:
- url: http://localhost:8089
description: "Server"
paths:
/users:
post:
summary: Creates a user and returns the user ID
operationId: createUser
requestBody:
required: true
description: A JSON object that contains the user name and age.
content:
application/json:
schema:
$ref: '#/components/schemas/User'
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
id:
type: integer
format: int64
description: ID of the created user.
# -----------------------------------------------------
# Links
# -----------------------------------------------------
links:
GetUserByUserId: # <---- arbitrary name for the link
operationId: getUser
# or
# operationRef: '#/paths/~1users~1{userId}/get'
parameters:
userId: '$response.body#/id'
description: >
The `id` value returned in the response can be used as
the `userId` parameter in `GET /users/{userId}`.
# -----------------------------------------------------
/users/{userId}:
get:
summary: Gets a user by ID
operationId: getUser
parameters:
- in: path
name: userId
required: true
schema:
type: integer
format: int64
responses:
'200':
description: A User object
content:
application/json:
schema:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: integer
format: int64
readOnly: true
name:
type: string
Screenshots
Summary
As you can see, I have performed 2 different request to server, but I cannot see any proper links generated. They exists only in example response section but they are static.
Is there any thing wrong with my code or runtime expressions just do not work?
The text was updated successfully, but these errors were encountered:
Any update on it?
I'm currently trying to make it work but I have still {$request.query.endpointUrl} in the http page instead of the url put in the query.
How can we use this nice feature?
Description
I have been following line by line official tutorial about OAS 3.0 Links (https://swagger.io/docs/specification/links/), but it seems to me that "runtime expressions" feature is not implemented yet. Runtime expressions are not updating values or creating links dynamically when I made request to server with implemented logic.
OpenAPI definition
Screenshots
Summary
As you can see, I have performed 2 different request to server, but I cannot see any proper links generated. They exists only in example response section but they are static.
Is there any thing wrong with my code or runtime expressions just do not work?
The text was updated successfully, but these errors were encountered: