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'm encountering what I believe is a bug (or maybe it's intended behavior) where I'm locally referencing a component which will be in the resolved output. Instead of keeping the local reference, speccy is changing it to an empty object.
Here's my test case:
# test.yml
---
openapi: 3.0.1
info:
title: My API
version: v1
contact:
name: API Support
url: https://example.com
email: support@example.com
paths:
"/users":
"$ref": ./paths/users.yml
servers:
- url: https://api.example.com
components:
schemas:
user:
"$ref": ./schemas/user.yml
# paths/users.yml
---
get:
summary: Gets the current user
operationId: get-user
responses:
'200':
description: ok
content:
application/json:
schema:
$ref: '#/components/schemas/user'
My expected/desired output:
openapi: 3.0.1
info:
title: My API
version: v1
contact:
name: API Support
url: https://example.com
email: support@example.com
paths:
/users:
get:
summary: Gets the current user
operationId: get-user
responses:
"200":
description: ok
content:
application/json:
schema: '#/components/schemas/user'
servers:
- url: https://api.example.com
components:
schemas:
user:
type: object
properties:
id:
type: integer
example: 4
first_name:
type: string
example: Gandalf
surname:
type: string
example: McKellen
email:
type: string
format: email
example: gandalf@example.com
country:
type: string
example: The Shire
Actual output running speccy resolve test.yml:
openapi: 3.0.1
info:
title: My API
version: v1
contact:
name: API Support
url: https://example.com
email: support@example.com
paths:
/users:
get:
summary: Gets the current user
operationId: get-user
responses:
"200":
description: ok
content:
application/json:
schema: {}
servers:
- url: https://api.example.com
components:
schemas:
user:
type: object
properties:
id:
type: integer
example: 4
first_name:
type: string
example: Gandalf
surname:
type: string
example: McKellen
email:
type: string
format: email
example: gandalf@example.com
country:
type: string
example: The Shire
I want to define user once in components/schemas and reference it in many different paths. What would be the best way to achieve this?
The text was updated successfully, but these errors were encountered:
I'm encountering what I believe is a bug (or maybe it's intended behavior) where I'm locally referencing a component which will be in the resolved output. Instead of keeping the local reference, speccy is changing it to an empty object.
Here's my test case:
My expected/desired output:
Actual output running
speccy resolve test.yml
:I want to define user once in components/schemas and reference it in many different paths. What would be the best way to achieve this?
The text was updated successfully, but these errors were encountered: