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
openapi: "3.0.0"info:
version: 1.0.0title: Authenticated API Exampledescription: An example API which uses bearer token scopes and JWT authpaths:
/things:
get:
operationId: listThingsdescription: | Returns a list of things. Because this endpoint doesn't override the global security, it requires a JWT for authentication.responses:
200:
description: a list of thingscontent:
application/json:
schema:
type: arrayitems:
$ref: "#/components/schemas/ThingWithID"post:
operationId: addThingdescription: | Adds a thing to the list of things. This endpoints overrides the global security scheme and requires a `things:w` scope in order to perform a write.security:
- BearerAuth:
- "things:w"requestBody:
description: A thing to insert. Returns the inserted thing with an IDrequired: truecontent:
application/json:
schema:
$ref: "#/components/schemas/Thing"responses:
201:
description: The inserted Thing with a unique IDcontent:
application/json:
schema:
type: arrayitems:
$ref: "#/components/schemas/ThingWithID"components:
schemas:
Thing:
properties:
name:
type: stringrequired:
- nameThingWithID:
allOf:
- $ref: "#/components/schemas/Thing"
- properties:
id:
type: integerformat: int64required:
- idError:
required:
- code
- messageproperties:
code:
type: integerformat: int32description: Error codemessage:
type: stringdescription: Error messagesecuritySchemes:
BearerAuth:
type: httpscheme: bearerbearerFormat: JWTsecurity:
- BearerAuth: []
produces:
/* istanbul ignore file *//* tslint:disable *//* eslint-disable */exporttypeThing={};
/* istanbul ignore file *//* tslint:disable *//* eslint-disable */importtype{Thing}from'./Thing';exporttypeThingWithID=Thing;
The Thing and ThingWithID types are both empty.
Also, ThingWithID should be:
exporttypeThingWithID=Thing&{id: number}
Or something similar, but I'm assuming this has to do with the fact that neither type is being read properly.
The text was updated successfully, but these errors were encountered:
chanced
changed the title
component schemas fields are blank.
Model fields generated from component schemas are empty.
Aug 3, 2022
chanced
changed the title
Model fields generated from component schemas are empty.
Model's fields generated from component schemas are empty.
Aug 3, 2022
Seems like most tooling allows type: object to be missing, and neither Spectral nor Redocly complains. I've tried to dig into the JSON schema specifications to verify that it can indeed be implicit, but it's a really hard read.
Using this 3.0 openapi spec:
produces:
The
Thing
andThingWithID
types are both empty.Also,
ThingWithID
should be:Or something similar, but I'm assuming this has to do with the fact that neither type is being read properly.
The text was updated successfully, but these errors were encountered: