Skip to content
Snippets Groups Projects
Commit bc6976bc authored by Jueun Park's avatar Jueun Park
Browse files

edited OpenAPISpecification.relast, Parser.jrag, ReverseParser.jrag

parent a1c178f7
No related branches found
No related tags found
1 merge request!1Tests/openapi generator
//OpenAPI Object //OpenAPI Object
OpenAPIObject ::= <OpenAPI> <JsonSchemaDialect> [i:InfoObject] s:ServerObject* p:PathsObject* w:Webhook* [c:ComponentsObject] sr:SecurityRequirementObject* t:TagObject* [e:ExternalDocObject] ex:Extension* ; OpenAPIObject ::= <OpenAPI> <JsonSchemaDialect> [I:InfoObject] Serv:ServerObject* P:PathsObject* W:Webhook* [C:ComponentsObject] Sr:SecurityRequirementObject* T:TagObject* [E:ExternalDocObject] Ex:Extension* ;
Webhook ::= <Key> p:PathItemOb; Webhook ::= <Key> p:PathItemOb;
//Info Object //Info Object
InfoObject ::= <Title> <Summary> <Description> <TermsOfService> <Version> [c:ContactObject] [l:LicenseObject] ex:Extension*; InfoObject ::= <Title> <Summary> <Description> <TermsOfService> <Version> [C:ContactObject] [L:LicenseObject] Ex:Extension*;
//Contact Object //Contact Object
ContactObject ::= <Name> <Url> <Email> ex:Extension*; ContactObject ::= <Name> <Url> <Email> Ex:Extension*;
//License Object //License Object
LicenseObject ::= <Name> <Identifier> <Url> ex:Extension*; LicenseObject ::= <Name> <Identifier> <Url> Ex:Extension*;
//Server Object //Server Object
ServerObject ::= <Url> <Description> st:ServerVariablesTuple* ex:Extension*; ServerObject ::= <Url> <Description> St:ServerVariablesTuple* Ex:Extension*;
ServerVariablesTuple ::= <Name> s:ServerVariableObject; ServerVariablesTuple ::= <Name> S:ServerVariableObject;
//Server Variable Object //Server Variable Object
ServerVariableObject ::= <Default> <Description> e:Enum* ex:Extension*; ServerVariableObject ::= <Default> <Description> E:Enum* Ex:Extension*;
Enum ::= <EnumValue>; Enum ::= <EnumValue>;
//Components Object //Components Object
ComponentsObject ::= s:SchemaTuple* r:ResponseTuple* p:ParameterTuple* e:ExampleTuple* rb:RequestBodyTuple* h:HeaderTuple* sc:SecuritySchemeObject* l:LinkTuple* c:CallbackTuple* pi:PathItemTuple* ex:Extension*; ComponentsObject ::= S:SchemaTuple* R:ResponseTuple* P:ParameterTuple* E:ExampleTuple* Rb:RequestBodyTuple* H:HeaderTuple* Sc:SecuritySchemeTuple* L:LinkTuple* C:CallbackTuple* Pi:PathItemTuple* Ex:Extension*;
SchemaTuple ::= <Key> o:SchemaOb; SchemaTuple ::= <Key> O:SchemaOb;
ResponseTuple ::= <Key> o:ResponseOb; ResponseTuple ::= <Key> O:ResponseOb;
ParameterTuple ::= <Key> o:ParameterOb; ParameterTuple ::= <Key> O:ParameterOb;
ExampleTuple ::= <Key> o:ExampleObject; ExampleTuple ::= <Key> O:ExampleObject;
RequestBodyTuple ::= <Key> o:RequestBodyOb; RequestBodyTuple ::= <Key> O:RequestBodyOb;
HeaderTuple ::= <Key> o:HeaderOb; HeaderTuple ::= <Key> O:HeaderOb;
SecuritySchemeTuple ::= <Key> o:SecuritySchemeOb; SecuritySchemeTuple ::= <Key> O:SecuritySchemeOb;
LinkTuple ::= <Key> o:LinkOb; LinkTuple ::= <Key> O:LinkOb;
CallbackTuple ::= <Key> o:CallbackOb; CallbackTuple ::= <Key> O:CallbackOb;
PathItemTuple ::= <Key> o:PathItemOb; PathItemTuple ::= <Key> O:PathItemOb;
//Paths Object //Paths Object
PathsObject ::= <Ref> p:PathItemOb; PathsObject ::= <Ref> P:PathItemOb;
//Path Item Object //Path Item Object
abstract PathItemOb; abstract PathItemOb;
PathItemReference : PathItemOb ::= <Ref> <Summary> <Description>; PathItemReference : PathItemOb ::= <Ref> <Summary> <Description>;
rel PathItemReference.r -> PathItemObject; rel PathItemReference.r -> PathItemObject;
PathItemObject : PathItemOb ::= <Ref> <Summary> <Description> [g:Get] [put:Put] [post:Post] [d:Delete] [o:Options] [h:Head] [p:Patch] [t:Trace] s:ServerObject* po:ParameterOb* ex:Extension*; PathItemObject : PathItemOb ::= <Ref> <Summary> <Description> [G:Get] [PutOb:Put] [PostOb:Post] [D:Delete] [O:Options] [H:Head] [PatchOb:Patch] [T:Trace] S:ServerObject* Po:ParameterOb* Ex:Extension*;
//Operation Object //Operation Object
OperationObject ::= <Summary> <Description> <OperationID> <DeprecatedBoolean:Boolean> t:Tag* [ed:ExternalDocObject] p:ParameterOb* [rb:RequestBodyOb] r:ResponsesObject c:CallbackTuple* sr:SecurityRequirementObject* s:ServerObject* ex:Extension*; OperationObject ::= <Summary> <Description> <OperationID> <DeprecatedBoolean:Boolean> T:Tag* [Ed:ExternalDocObject] P:ParameterOb* [Rb:RequestBodyOb] R:ResponsesObject C:CallbackTuple* Sr:SecurityRequirementObject* S:ServerObject* Ex:Extension*;
Get ::= o:OperationObject; Get ::= O:OperationObject;
Put ::= o:OperationObject; Put ::= O:OperationObject;
Post ::= o:OperationObject; Post ::= O:OperationObject;
Delete ::= o:OperationObject; Delete ::= O:OperationObject;
Options ::= o:OperationObject; Options ::= O:OperationObject;
Head ::= o:OperationObject; Head ::= O:OperationObject;
Patch ::= o:OperationObject; Patch ::= O:OperationObject;
Trace ::= o:OperationObject; Trace ::= O:OperationObject;
Tag ::= <Tag>; Tag ::= <Tag>;
//External Documentation Object //External Documentation Object
ExternalDocObject ::= <Description> <Url> ex:Extension*; ExternalDocObject ::= <Description> <Url> Ex:Extension*;
//Parameter Object //Parameter Object
abstract ParameterOb; abstract ParameterOb;
ParameterReference : ParameterOb ::= <Ref> <Summary> <Description>; ParameterReference : ParameterOb ::= <Ref> <Summary> <Description>;
rel ParameterReference.p -> ParameterObject; rel ParameterReference.p -> ParameterObject;
ParameterObject : ParameterOb ::= <Name> <In> <Description> <Required:Boolean> <DeprecatedBoolean:Boolean> <AllowEmptyValue:Boolean> <Style> <Explode:Boolean> <AllowReserved:Boolean> <Example:Object> [s:SchemaOb] e:ExampleTuple* c:ContentTuple* ex:Extension*; ParameterObject : ParameterOb ::= <Name> <In> <Description> <Required:Boolean> <DeprecatedBoolean:Boolean> <AllowEmptyValue:Boolean> <Style> <Explode:Boolean> <AllowReserved:Boolean> <Example:Object> [Schema:SchemaOb] E:ExampleTuple* C:ContentTuple* Ex:Extension*;
ContentTuple ::= <Key> m:MediaTypeObject; ContentTuple ::= <Key> M:MediaTypeObject;
//Request Body Object //Request Body Object
abstract RequestBodyOb; abstract RequestBodyOb;
RequestBodyReference : RequestBodyOb ::= <Ref> <Summary> <Description>; RequestBodyReference : RequestBodyOb ::= <Ref> <Summary> <Description>;
rel RequestBodyReference.r -> RequestBodyObject; rel RequestBodyReference.r -> RequestBodyObject;
RequestBodyObject : RequestBodyOb ::= <Description> <Required:Boolean> c:ContentTuple* ex:Extension*; RequestBodyObject : RequestBodyOb ::= <Description> <Required:Boolean> C:ContentTuple* Ex:Extension*;
//Media Type Object //Media Type Object
MediaTypeObject ::= <Example:Object> [s:SchemaOb] e:ExampleTuple* en:EncodingTuple* ex:Extension*; MediaTypeObject ::= <Example:Object> [S:SchemaOb] E:ExampleTuple* En:EncodingTuple* Ex:Extension*;
EncodingTuple ::= <Key> e:EncodingTuple; EncodingTuple ::= <Key> E:EncodingObject;
//Encoding Object //Encoding Object
EncodingObject ::= <ContentType> <Style> <Explode:Boolean> <AllowReserved:Boolean> h:HeaderTuple* ex:Extension*; EncodingObject ::= <ContentType> <Style> <Explode:Boolean> <AllowReserved:Boolean> H:HeaderTuple* Ex:Extension*;
//Responses Object (ResponseTuple is used for HTTPStatusCode) //Responses Object (ResponseTuple is used for HTTPStatusCode)
ResponsesObject ::= r:ResponseTuple*; ResponsesObject ::= R:ResponseTuple*;
//Response Object //Response Object
abstract ResponseOb; abstract ResponseOb;
ResponseReference : ResponseOb ::= <Ref> <Summary> <Description>; ResponseReference : ResponseOb ::= <Ref> <Summary> <Description>;
rel ResponseReference.r -> ResponseObject; rel ResponseReference.r -> ResponseObject;
ResponseObject : ResponseOb ::= <Description> h:HeaderTuple* c:ContentTuple* l:LinkTuple* ex:Extension*; ResponseObject : ResponseOb ::= <Description> H:HeaderTuple* C:ContentTuple* L:LinkTuple* Ex:Extension*;
//Callback Object //Callback Object
abstract CallbackOb; abstract CallbackOb;
CallbackReference : CallbackOb ::= <Ref> <Summary> <Description>; CallbackReference : CallbackOb ::= <Ref> <Summary> <Description>;
rel CallbackReference.r -> CallbackObject; rel CallbackReference.r -> CallbackObject;
CallbackObject : CallbackOb ::= e:Expression* ex:Extension*; CallbackObject : CallbackOb ::= E:Expression* Ex:Extension*;
Extension ::= <Key> <Value:Object>; Extension ::= <Key> <Value:Object>;
Expression ::= <Name> p:PathItemOb; Expression ::= <Name> P:PathItemOb;
//Example Object //Example Object
ExampleObject ::= <Summary> <Description> <Value:Object> <ExternalValue> ex:Extension*; ExampleObject ::= <Summary> <Description> <Value:Object> <ExternalValue> Ex:Extension*;
//Link Object //Link Object
abstract LinkOb; abstract LinkOb;
LinkReference : LinkOb ::= <Ref> <Summary> <Description>; LinkReference : LinkOb ::= <Ref> <Summary> <Description>;
rel LinkReference.r -> LinkObject; rel LinkReference.r -> LinkObject;
LinkObject : LinkOb ::= <OperationRef> <OperationID> <LinkRequestBody:Object> <Description> l:LinkParameterTuple* [s:ServerObject] ex:Extension*; LinkObject : LinkOb ::= <OperationRef> <OperationID> <LinkRequestBody:Object> <Description> L:LinkParameterTuple* [S:ServerObject] Ex:Extension*;
LinkParameterTuple ::= <Key> <Value>; LinkParameterTuple ::= <Key> <Value>;
...@@ -111,55 +111,55 @@ LinkParameterTuple ::= <Key> <Value>; ...@@ -111,55 +111,55 @@ LinkParameterTuple ::= <Key> <Value>;
abstract HeaderOb; abstract HeaderOb;
HeaderReference : HeaderOb ::= <Ref> <Summary> <Description>; HeaderReference : HeaderOb ::= <Ref> <Summary> <Description>;
rel HeaderReference.r -> HeaderObject; rel HeaderReference.r -> HeaderObject;
HeaderObject : HeaderOb ::= <Description> <Required:Boolean> <DeprecatedBoolean:Boolean> <AllowEmptyValue:Boolean> <Style> <Explode:Boolean> <AllowReserved:Boolean> <Example:Object> [s:SchemaOb] e:ExampleTuple* c:ContentTuple* ex:Extension*; HeaderObject : HeaderOb ::= <Description> <Required:Boolean> <DeprecatedBoolean:Boolean> <AllowEmptyValue:Boolean> <Style> <Explode:Boolean> <AllowReserved:Boolean> <Example:Object> [S:SchemaOb] E:ExampleTuple* C:ContentTuple* Ex:Extension*;
//Tag Object //Tag Object
TagObject ::= <Name> <Description> [e:ExternalDocObject] ex:Extension*; TagObject ::= <Name> <Description> [E:ExternalDocObject] Ex:Extension*;
//Schema Object //Schema Object
abstract SchemaOb; abstract SchemaOb;
SchemaReference : SchemaOb ::= <Ref> <Summary> <Description>; SchemaReference : SchemaOb ::= <Ref> <Summary> <Description>;
rel SchemaReference.r -> SchemaObject; rel SchemaReference.r -> SchemaObject;
SchemaObject : SchemaOb ::= <AdditionalProperties:Object> <DefaultValue:Object> <Description> <DeprecatedBoolean:Boolean> <ExclusiveMaximum:Number> <ExclusiveMinimum:Number> <Format> <Maximum:Number> <Minimum:Number> <MaxItems:Integer> <MinItems:Integer> <MaxLength:Integer> <MinLength:Integer> <MaxProperties:Integer> <MinProperties:Integer> <MultipleOf:Number> <Pattern> <ReadOnly:Boolean> <WriteOnly:Boolean> <Type> <Title> <UniqueItems:Boolean> <MaxContains:Integer> <MinContains:Integer> <DependentRequired:Object> <DependentSchema:SchemaOb> <Const:Object> [d:DiscriminatorObject] e:EnumObj* el:ExampleElement* [ext:ExternalDocObject] [i:ItemsSchema] [n:NotSchema] p:PropertyItem* r:RequiredField* all:AllOfSchema* any:AnyOfSchema* one:OneOfSchema* t:TypeArray* [x:XmlObject] ex:Extension*; SchemaObject : SchemaOb ::= <AdditionalProperties:Object> <DefaultValue:Object> <Description> <DeprecatedBoolean:Boolean> <ExclusiveMaximum:Number> <ExclusiveMinimum:Number> <Format> <Maximum:Number> <Minimum:Number> <MaxItems:Integer> <MinItems:Integer> <MaxLength:Integer> <MinLength:Integer> <MaxProperties:Integer> <MinProperties:Integer> <MultipleOf:Number> <Pattern> <ReadOnly:Boolean> <WriteOnly:Boolean> <Type> <Title> <UniqueItems:Boolean> <MaxContains:Integer> <MinContains:Integer> <DependentRequired:Object> <DependentSchema:SchemaOb> <Const:Object> [D:DiscriminatorObject] E:EnumObj* El:ExampleElement* [Ext:ExternalDocObject] [I:ItemsSchema] [N:NotSchema] P:PropertyItem* R:RequiredField* All:AllOfSchema* Any:AnyOfSchema* One:OneOfSchema* T:TypeArray* [X:XmlObject] Ex:Extension*;
ItemsSchema ::= s:SchemaOb; ItemsSchema ::= Schema:SchemaOb;
NotSchema ::= s:SchemaOb; NotSchema ::= Schema:SchemaOb;
PropertyItem ::= <Name> s:SchemaOb; PropertyItem ::= <Name> Schema:SchemaOb;
AllOfSchema ::= s:SchemaOb; AllOfSchema ::= Schema:SchemaOb;
AnyOfSchema ::= s:SchemaOb; AnyOfSchema ::= Schema:SchemaOb;
OneOfSchema ::= s:SchemaOb; OneOfSchema ::= Schema:SchemaOb;
ExampleElement ::= <Example:Object>; ExampleElement ::= <Example:Object>;
TypeArray ::= <TypeElements:Object>; TypeArray ::= <TypeElements:Object>;
EnumObj ::= <EnumOb:Object>; EnumObj ::= <EnumOb:Object>;
RequiredField ::= <Value>; RequiredField ::= <Value>;
//Discriminator Object //Discriminator Object
DiscriminatorObject ::= <PropertyName> m:MappingTuple* ex:Extension*; DiscriminatorObject ::= <PropertyName> M:MappingTuple* Ex:Extension*;
MappingTuple ::= <Key> <Value>; MappingTuple ::= <Key> <Value>;
//XML Object //XML Object
XmlObject ::= <Name> <Namespace> <Prefix> <Attribute:Boolean> <Wrapped:Boolean> ex:Extension*; XmlObject ::= <Name> <Namespace> <Prefix> <Attribute:Boolean> <Wrapped:Boolean> Ex:Extension*;
//Security Scheme Object //Security Scheme Object
abstract SecuritySchemeOb; abstract SecuritySchemeOb;
SecuritySchemeReference : SecuritySchemeOb ::= <Ref> <Summary> <Description>; SecuritySchemeReference : SecuritySchemeOb ::= <Ref> <Summary> <Description>;
rel SecuritySchemeReference.r -> SecuritySchemeObject; rel SecuritySchemeReference.r -> SecuritySchemeObject;
SecuritySchemeObject : SecuritySchemeOb ::= <Type> <Description> <Name> <In> <Scheme> <BearerFormat> <OpenIdConnectUrl> [o:OAuthFlowsObject] ex:Extension*; SecuritySchemeObject : SecuritySchemeOb ::= <Type> <Description> <Name> <In> <Scheme> <BearerFormat> <OpenIdConnectUrl> [O:OAuthFlowsObject] Ex:Extension*;
//OAuth Flows Object //OAuth Flows Object
OAuthFlowsObject ::= [i:Implicit] [p:Password] [c:ClientCredentials] [a:AuthorizationCode] ex:Extension*; OAuthFlowsObject ::= [I:Implicit] [P:Password] [C:ClientCredentials] [A:AuthorizationCode] Ex:Extension*;
Implicit ::= o:OAuthFlowObject; Implicit ::= O:OAuthFlowObject;
Password ::= o:OAuthFlowObject; Password ::= O:OAuthFlowObject;
ClientCredentials ::= o:OAuthFlowObject; ClientCredentials ::= O:OAuthFlowObject;
AuthorizationCode ::= o:OAuthFlowObject; AuthorizationCode ::= O:OAuthFlowObject;
//OAuth Flow Object //OAuth Flow Object
OAuthFlowObject ::= <AuthorizationUrl> <TokenUrl> <RefreshUrl> s:ScopesTuple* ex:Extension*; OAuthFlowObject ::= <AuthorizationUrl> <TokenUrl> <RefreshUrl> S:ScopesTuple* Ex:Extension*;
ScopesTuple ::= <ScopesKey> <ScopesValue>; ScopesTuple ::= <ScopesKey> <ScopesValue>;
//Security Requirement Object //Security Requirement Object
SecurityRequirementObject ::= t:SecurityRequirementTuple*; SecurityRequirementObject ::= Tuple:SecurityRequirementTuple*;
SecurityRequirementTuple ::= <Name> v:SecurityRequirementValue*; SecurityRequirementTuple ::= <Name> Value:SecurityRequirementValue*;
SecurityRequirementValue ::= <Value>; SecurityRequirementValue ::= <Value>;
\ No newline at end of file
...@@ -22,17 +22,17 @@ public static OpenAPIObject OpenAPIObject.parseOpenAPI(OpenAPI api) { ...@@ -22,17 +22,17 @@ public static OpenAPIObject OpenAPIObject.parseOpenAPI(OpenAPI api) {
if (api.getOpenapi() != null) if (api.getOpenapi() != null)
openapi.setOpenAPI(api.getOpenapi()); openapi.setOpenAPI(api.getOpenapi());
if (api.getInfo() != null) if (api.getInfo() != null)
openapi.set_impl_i(InfoObject.parseInfo(api.getInfo())); openapi.setI(InfoObject.parseInfo(api.getInfo()));
if (api.getPaths() != null) { if (api.getPaths() != null) {
for (String key : api.getPaths().keySet()) for (String key : api.getPaths().keySet())
openapi.addP(new PathsObject(key, PathItemObject.parsePath(api.getPaths().get(key)))); openapi.addP(new PathsObject(key, PathItemObject.parsePath(api.getPaths().get(key))));
} }
if (api.getServers() != null) { if (api.getServers() != null) {
for (io.swagger.v3.oas.models.servers.Server s : api.getServers()) for (io.swagger.v3.oas.models.servers.Server s : api.getServers())
openapi.addS(ServerObject.parseServer(s)); openapi.addServ(ServerObject.parseServer(s));
} }
if (api.getComponents() != null) if (api.getComponents() != null)
openapi.set_impl_c(ComponentsObject.parseComponents(api.getComponents())); openapi.setC(ComponentsObject.parseComponents(api.getComponents()));
if (api.getSecurity() != null) { if (api.getSecurity() != null) {
for (io.swagger.v3.oas.models.security.SecurityRequirement s : api.getSecurity()) for (io.swagger.v3.oas.models.security.SecurityRequirement s : api.getSecurity())
openapi.addSr(SecurityRequirementObject.parseSecurityRequirement(s)); openapi.addSr(SecurityRequirementObject.parseSecurityRequirement(s));
...@@ -42,7 +42,7 @@ public static OpenAPIObject OpenAPIObject.parseOpenAPI(OpenAPI api) { ...@@ -42,7 +42,7 @@ public static OpenAPIObject OpenAPIObject.parseOpenAPI(OpenAPI api) {
openapi.addT(TagObject.parseTag(t)); openapi.addT(TagObject.parseTag(t));
} }
if (api.getExternalDocs() != null) if (api.getExternalDocs() != null)
openapi.set_impl_e(ExternalDocObject.parseExternalDocs(api.getExternalDocs())); openapi.setE(ExternalDocObject.parseExternalDocs(api.getExternalDocs()));
if (api.getExtensions().size() != 0) { if (api.getExtensions().size() != 0) {
for (String key : api.getExtensions().keySet()) for (String key : api.getExtensions().keySet())
openapi.addEx(new Extension(key, api.getExtensions().get(key))); openapi.addEx(new Extension(key, api.getExtensions().get(key)));
...@@ -67,9 +67,9 @@ public static InfoObject InfoObject.parseInfo(io.swagger.v3.oas.models.info.Info ...@@ -67,9 +67,9 @@ public static InfoObject InfoObject.parseInfo(io.swagger.v3.oas.models.info.Info
if (info.getTermsOfService() != null) if (info.getTermsOfService() != null)
infoObject.setTermsOfService(info.getTermsOfService()); infoObject.setTermsOfService(info.getTermsOfService());
if (info.getContact() != null) if (info.getContact() != null)
infoObject.set_impl_c(ContactObject.parseContact(info.getContact())); infoObject.setC(ContactObject.parseContact(info.getContact()));
if (info.getLicense() != null) if (info.getLicense() != null)
infoObject.set_impl_l(LicenseObject.parseLicense(info.getLicense())); infoObject.setL(LicenseObject.parseLicense(info.getLicense()));
if (info.getExtensions().size() != 0) { if (info.getExtensions().size() != 0) {
for (String key : info.getExtensions().keySet()) for (String key : info.getExtensions().keySet())
infoObject.addEx(new Extension(key, info.getExtensions().get(key))); infoObject.addEx(new Extension(key, info.getExtensions().get(key)));
...@@ -229,42 +229,42 @@ public static PathItemOb PathItemOb.parsePath(PathItem path) { ...@@ -229,42 +229,42 @@ public static PathItemOb PathItemOb.parsePath(PathItem path) {
pathItem.setDescription(path.getDescription()); pathItem.setDescription(path.getDescription());
if (path.getGet() != null) { if (path.getGet() != null) {
Get get = new Get(); Get get = new Get();
get.set_impl_o(OperationObject.parseOperation(path.getGet())); get.setO(OperationObject.parseOperation(path.getGet()));
pathItem.setG(get); pathItem.setG(get);
} }
if (path.getPut() != null) { if (path.getPut() != null) {
Put put = new Put(); Put put = new Put();
put.set_impl_o(OperationObject.parseOperation(path.getPut())); put.setO(OperationObject.parseOperation(path.getPut()));
pathItem.setPut(put); pathItem.setPutOb(put);
} }
if (path.getPost() != null) { if (path.getPost() != null) {
Post post = new Post(); Post post = new Post();
post.set_impl_o(OperationObject.parseOperation(path.getPost())); post.setO(OperationObject.parseOperation(path.getPost()));
pathItem.setPost(post); pathItem.setPostOb(post);
} }
if (path.getDelete() != null) { if (path.getDelete() != null) {
Delete delete = new Delete(); Delete delete = new Delete();
delete.set_impl_o(OperationObject.parseOperation(path.getDelete())); delete.setO(OperationObject.parseOperation(path.getDelete()));
pathItem.set_impl_d(delete); pathItem.setD(delete);
} }
if (path.getOptions() != null) { if (path.getOptions() != null) {
Options options = new Options(); Options options = new Options();
options.set_impl_o(OperationObject.parseOperation(path.getOptions())); options.setO(OperationObject.parseOperation(path.getOptions()));
pathItem.set_impl_o(options); pathItem.setO(options);
} }
if (path.getHead() != null) { if (path.getHead() != null) {
Head head = new Head(); Head head = new Head();
head.set_impl_o(OperationObject.parseOperation(path.getHead())); head.setO(OperationObject.parseOperation(path.getHead()));
pathItem.setH(head); pathItem.setH(head);
} }
if (path.getPatch() != null) { if (path.getPatch() != null) {
Patch patch = new Patch(); Patch patch = new Patch();
patch.set_impl_o(OperationObject.parseOperation(path.getPatch())); patch.setO(OperationObject.parseOperation(path.getPatch()));
pathItem.setP(patch); pathItem.setPatchOb(patch);
} }
if (path.getTrace() != null) { if (path.getTrace() != null) {
Trace trace = new Trace(); Trace trace = new Trace();
trace.set_impl_o(OperationObject.parseOperation(path.getTrace())); trace.setO(OperationObject.parseOperation(path.getTrace()));
pathItem.setT(trace); pathItem.setT(trace);
} }
if (path.getServers() != null) { if (path.getServers() != null) {
...@@ -300,7 +300,7 @@ public static OperationObject OperationObject.parseOperation(io.swagger.v3.oas.m ...@@ -300,7 +300,7 @@ public static OperationObject OperationObject.parseOperation(io.swagger.v3.oas.m
if (operation.getDescription() != null) if (operation.getDescription() != null)
operationObject.setDescription(operation.getDescription()); operationObject.setDescription(operation.getDescription());
if (operation.getExternalDocs() != null) if (operation.getExternalDocs() != null)
operationObject.set_impl_ed(ExternalDocObject.parseExternalDocs(operation.getExternalDocs())); operationObject.setEd(ExternalDocObject.parseExternalDocs(operation.getExternalDocs()));
if (operation.getOperationId() != null) if (operation.getOperationId() != null)
operationObject.setOperationID(operation.getOperationId()); operationObject.setOperationID(operation.getOperationId());
if (operation.getParameters() != null) { if (operation.getParameters() != null) {
...@@ -308,12 +308,12 @@ public static OperationObject OperationObject.parseOperation(io.swagger.v3.oas.m ...@@ -308,12 +308,12 @@ public static OperationObject OperationObject.parseOperation(io.swagger.v3.oas.m
operationObject.addP(ParameterOb.parseParameter(p)); operationObject.addP(ParameterOb.parseParameter(p));
} }
if (operation.getRequestBody() != null) if (operation.getRequestBody() != null)
operationObject.set_impl_rb(RequestBodyOb.parseRequestBody(operation.getRequestBody())); operationObject.setRb(RequestBodyOb.parseRequestBody(operation.getRequestBody()));
if (operation.getResponses().size() != 0) { if (operation.getResponses().size() != 0) {
ResponsesObject r = new ResponsesObject(); ResponsesObject r = new ResponsesObject();
for (String key : operation.getResponses().keySet()) for (String key : operation.getResponses().keySet())
r.addR(new ResponseTuple(key, ResponseObject.parseResponse(operation.getResponses().get(key)))); r.addR(new ResponseTuple(key, ResponseObject.parseResponse(operation.getResponses().get(key))));
operationObject.set_impl_r(r); operationObject.setR(r);
} }
if (operation.getCallbacks().size() != 0) { if (operation.getCallbacks().size() != 0) {
for (String key : operation.getCallbacks().keySet()) for (String key : operation.getCallbacks().keySet())
...@@ -380,7 +380,7 @@ public static ParameterOb ParameterOb.parseParameter(Parameter parameter) { ...@@ -380,7 +380,7 @@ public static ParameterOb ParameterOb.parseParameter(Parameter parameter) {
if (parameter.getAllowReserved() != null) if (parameter.getAllowReserved() != null)
parameterObject.setAllowReserved(parameter.getAllowReserved()); parameterObject.setAllowReserved(parameter.getAllowReserved());
if (parameter.getSchema() != null) if (parameter.getSchema() != null)
parameterObject.set_impl_s(SchemaOb.parseSchema(parameter.getSchema())); parameterObject.setSchema(SchemaOb.parseSchema(parameter.getSchema()));
if (parameter.getExample() != null) if (parameter.getExample() != null)
parameterObject.setExample(parameter.getExample()); parameterObject.setExample(parameter.getExample());
if (parameter.getExamples() != null) { if (parameter.getExamples() != null) {
...@@ -437,7 +437,7 @@ public static MediaTypeObject MediaTypeObject.parseMediaType(MediaType mediaType ...@@ -437,7 +437,7 @@ public static MediaTypeObject MediaTypeObject.parseMediaType(MediaType mediaType
MediaTypeObject mediaTypeObject = new MediaTypeObject(); MediaTypeObject mediaTypeObject = new MediaTypeObject();
if (mediaType.getSchema() != null) if (mediaType.getSchema() != null)
mediaTypeObject.set_impl_s(SchemaObject.parseSchema(mediaType.getSchema())); mediaTypeObject.setS(SchemaObject.parseSchema(mediaType.getSchema()));
if (mediaType.getExample() != null) if (mediaType.getExample() != null)
mediaTypeObject.setExample(mediaType.getExample()); mediaTypeObject.setExample(mediaType.getExample());
if (mediaType.getExamples().size() != 0) { if (mediaType.getExamples().size() != 0) {
...@@ -587,7 +587,7 @@ public static LinkOb LinkOb.parseLink(Link link) { ...@@ -587,7 +587,7 @@ public static LinkOb LinkOb.parseLink(Link link) {
if (link.getDescription() != null) if (link.getDescription() != null)
linkObject.setDescription(link.getDescription()); linkObject.setDescription(link.getDescription());
if (link.getServer() != null) if (link.getServer() != null)
linkObject.set_impl_s(ServerObject.parseServer(link.getServer())); linkObject.setS(ServerObject.parseServer(link.getServer()));
if (link.getExtensions().size() != 0) { if (link.getExtensions().size() != 0) {
for (String key : link.getExtensions().keySet()) for (String key : link.getExtensions().keySet())
linkObject.addEx(new Extension(key, link.getExtensions().get(key))); linkObject.addEx(new Extension(key, link.getExtensions().get(key)));
...@@ -632,7 +632,7 @@ public static HeaderOb HeaderOb.parseHeader(Header header) { ...@@ -632,7 +632,7 @@ public static HeaderOb HeaderOb.parseHeader(Header header) {
headerObject.addC(new ContentTuple(key, MediaTypeObject.parseMediaType(header.getContent().get(key)))); headerObject.addC(new ContentTuple(key, MediaTypeObject.parseMediaType(header.getContent().get(key))));
} }
if (header.getSchema() != null) if (header.getSchema() != null)
headerObject.set_impl_s(SchemaOb.parseSchema(header.getSchema())); headerObject.setS(SchemaOb.parseSchema(header.getSchema()));
if (header.getExtensions() != null) { if (header.getExtensions() != null) {
for (String key : header.getExtensions().keySet()) for (String key : header.getExtensions().keySet())
headerObject.addEx(new Extension(key, header.getExtensions().get(key))); headerObject.addEx(new Extension(key, header.getExtensions().get(key)));
...@@ -650,7 +650,7 @@ public static TagObject TagObject.parseTag(io.swagger.v3.oas.models.tags.Tag tag ...@@ -650,7 +650,7 @@ public static TagObject TagObject.parseTag(io.swagger.v3.oas.models.tags.Tag tag
if (tag.getDescription() != null) if (tag.getDescription() != null)
tagObject.setDescription(tag.getDescription()); tagObject.setDescription(tag.getDescription());
if (tag.getExternalDocs() != null) if (tag.getExternalDocs() != null)
tagObject.set_impl_e(ExternalDocObject.parseExternalDocs(tag.getExternalDocs())); tagObject.setE(ExternalDocObject.parseExternalDocs(tag.getExternalDocs()));
if (tag.getExtensions().size() != 0) { if (tag.getExtensions().size() != 0) {
for (String key : tag.getExtensions().keySet()) for (String key : tag.getExtensions().keySet())
tagObject.addEx(new Extension(key, tag.getExtensions().get(key))); tagObject.addEx(new Extension(key, tag.getExtensions().get(key)));
...@@ -723,8 +723,8 @@ public static SchemaOb SchemaOb.parseSchema (Schema<?> schema) { ...@@ -723,8 +723,8 @@ public static SchemaOb SchemaOb.parseSchema (Schema<?> schema) {
schemaObject.setMultipleOf(schema.getMultipleOf()); schemaObject.setMultipleOf(schema.getMultipleOf());
if (schema.getNot() != null) { if (schema.getNot() != null) {
NotSchema notSchema = new NotSchema(); NotSchema notSchema = new NotSchema();
notSchema.set_impl_s(parseSchema(schema.getNot())); notSchema.setSchema(parseSchema(schema.getNot()));
schemaObject.set_impl_n(notSchema); schemaObject.setN(notSchema);
} }
if (schema.getPattern() != null) if (schema.getPattern() != null)
schemaObject.setPattern(schema.getPattern()); schemaObject.setPattern(schema.getPattern());
...@@ -875,20 +875,20 @@ public static OAuthFlowsObject OAuthFlowsObject.parseOAuthFlows(OAuthFlows oAuth ...@@ -875,20 +875,20 @@ public static OAuthFlowsObject OAuthFlowsObject.parseOAuthFlows(OAuthFlows oAuth
AuthorizationCode authorizationCode = new AuthorizationCode(); AuthorizationCode authorizationCode = new AuthorizationCode();
if (oAuthFlows.getImplicit() != null) { if (oAuthFlows.getImplicit() != null) {
implicit.set_impl_o(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getImplicit())); implicit.setO(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getImplicit()));
oAuthFlowsObject.set_impl_i(implicit); oAuthFlowsObject.setI(implicit);
} }
if (oAuthFlows.getPassword() != null) { if (oAuthFlows.getPassword() != null) {
password.set_impl_o(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getPassword())); password.setO(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getPassword()));
oAuthFlowsObject.set_impl_p(password); oAuthFlowsObject.setP(password);
} }
if (oAuthFlows.getClientCredentials() != null) { if (oAuthFlows.getClientCredentials() != null) {
clientCredentials.set_impl_o(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getClientCredentials())); clientCredentials.setO(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getClientCredentials()));
oAuthFlowsObject.set_impl_c(clientCredentials); oAuthFlowsObject.setC(clientCredentials);
} }
if (oAuthFlows.getAuthorizationCode() != null) { if (oAuthFlows.getAuthorizationCode() != null) {
authorizationCode.set_impl_o(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getAuthorizationCode())); authorizationCode.setO(OAuthFlowObject.parseOAuthFlow(oAuthFlows.getAuthorizationCode()));
oAuthFlowsObject.set_impl_a(authorizationCode); oAuthFlowsObject.setA(authorizationCode);
} }
if (oAuthFlows.getExtensions() != null) { if (oAuthFlows.getExtensions() != null) {
for (String key : oAuthFlows.getExtensions().keySet()) for (String key : oAuthFlows.getExtensions().keySet())
...@@ -922,10 +922,10 @@ public static SecurityRequirementObject SecurityRequirementObject.parseSecurityR ...@@ -922,10 +922,10 @@ public static SecurityRequirementObject SecurityRequirementObject.parseSecurityR
if (securityRequirement != null) { if (securityRequirement != null) {
for (String key : securityRequirement.keySet()) { for (String key : securityRequirement.keySet()) {
List<SecurityRequirementValue> values = new ArrayList<>(); JastAddList<SecurityRequirementValue> values = new JastAddList<>();
for (String v : securityRequirement.get(key)) for (String v : securityRequirement.get(key))
values.add(new SecurityRequirementValue(v)); values.add(new SecurityRequirementValue(v));
securityRequirementObject.addT(new SecurityRequirementTuple(key, values)); securityRequirementObject.addTuple(new SecurityRequirementTuple(key, values));
} }
} }
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment