Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RAGO - RAG OpenAPI Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
RAGO - RAG OpenAPI Framework
Merge requests
!1
Tests/openapi generator
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Tests/openapi generator
tests/openapi-generator
into
main
Overview
0
Commits
50
Pipelines
17
Changes
27
Merged
Johannes Mey
requested to merge
tests/openapi-generator
into
main
3 years ago
Overview
0
Commits
50
Pipelines
17
Changes
1
Expand
Fixes
#1 (closed)
Edited
3 years ago
by
Johannes Mey
0
0
Merge request reports
Compare
version 10
version 48
52d27d09
3 years ago
version 47
a7ee3137
3 years ago
version 46
e6cdacff
3 years ago
version 45
cb0a6b4b
3 years ago
version 44
52b1eb77
3 years ago
version 43
cfbfa654
3 years ago
version 42
3510da12
3 years ago
version 41
bd1fef17
3 years ago
version 40
a1ab3c2f
3 years ago
version 39
6cec6cb6
3 years ago
version 38
006a5868
3 years ago
version 37
86bbd708
3 years ago
version 36
c618d168
3 years ago
version 35
7af950f7
3 years ago
version 34
921886e7
3 years ago
version 33
23a5c5ec
3 years ago
version 32
89fb6590
3 years ago
version 31
8f5368d4
3 years ago
version 30
e3d7a47b
3 years ago
version 29
5d13266b
3 years ago
version 28
a6635c54
3 years ago
version 27
c5afb7dd
3 years ago
version 26
049296ec
3 years ago
version 25
95c8505f
3 years ago
version 24
6f9cf2d4
3 years ago
version 23
95cbc4fb
3 years ago
version 22
a2f4cd46
3 years ago
version 21
4b68d919
3 years ago
version 20
40a31f5d
3 years ago
version 19
bc6976bc
3 years ago
version 18
a1c178f7
3 years ago
version 17
69acdfc6
3 years ago
version 16
778bcaba
3 years ago
version 15
bf2ceb26
3 years ago
version 14
9026377f
3 years ago
version 13
c2222fd6
3 years ago
version 12
2038b0b2
3 years ago
version 11
978ce03d
3 years ago
version 10
b937041d
3 years ago
version 9
2c90d3ff
3 years ago
version 8
0e4f6e50
3 years ago
version 7
503f808e
3 years ago
version 6
d5cb7f0c
3 years ago
version 5
84d34ecc
3 years ago
version 4
4ee2200d
3 years ago
version 3
7e28dbeb
3 years ago
version 2
bebc578f
3 years ago
version 1
6f30046c
3 years ago
main (base)
and
version 11
latest version
e74806b6
50 commits,
3 years ago
version 48
52d27d09
49 commits,
3 years ago
version 47
a7ee3137
48 commits,
3 years ago
version 46
e6cdacff
47 commits,
3 years ago
version 45
cb0a6b4b
46 commits,
3 years ago
version 44
52b1eb77
45 commits,
3 years ago
version 43
cfbfa654
44 commits,
3 years ago
version 42
3510da12
42 commits,
3 years ago
version 41
bd1fef17
41 commits,
3 years ago
version 40
a1ab3c2f
40 commits,
3 years ago
version 39
6cec6cb6
39 commits,
3 years ago
version 38
006a5868
38 commits,
3 years ago
version 37
86bbd708
37 commits,
3 years ago
version 36
c618d168
36 commits,
3 years ago
version 35
7af950f7
35 commits,
3 years ago
version 34
921886e7
34 commits,
3 years ago
version 33
23a5c5ec
33 commits,
3 years ago
version 32
89fb6590
32 commits,
3 years ago
version 31
8f5368d4
31 commits,
3 years ago
version 30
e3d7a47b
30 commits,
3 years ago
version 29
5d13266b
29 commits,
3 years ago
version 28
a6635c54
28 commits,
3 years ago
version 27
c5afb7dd
27 commits,
3 years ago
version 26
049296ec
26 commits,
3 years ago
version 25
95c8505f
25 commits,
3 years ago
version 24
6f9cf2d4
24 commits,
3 years ago
version 23
95cbc4fb
23 commits,
3 years ago
version 22
a2f4cd46
22 commits,
3 years ago
version 21
4b68d919
21 commits,
3 years ago
version 20
40a31f5d
20 commits,
3 years ago
version 19
bc6976bc
19 commits,
3 years ago
version 18
a1c178f7
18 commits,
3 years ago
version 17
69acdfc6
17 commits,
3 years ago
version 16
778bcaba
16 commits,
3 years ago
version 15
bf2ceb26
15 commits,
3 years ago
version 14
9026377f
14 commits,
3 years ago
version 13
c2222fd6
13 commits,
3 years ago
version 12
2038b0b2
12 commits,
3 years ago
version 11
978ce03d
11 commits,
3 years ago
version 10
b937041d
10 commits,
3 years ago
version 9
2c90d3ff
9 commits,
3 years ago
version 8
0e4f6e50
8 commits,
3 years ago
version 7
503f808e
7 commits,
3 years ago
version 6
d5cb7f0c
6 commits,
3 years ago
version 5
84d34ecc
5 commits,
3 years ago
version 4
4ee2200d
4 commits,
3 years ago
version 3
7e28dbeb
3 commits,
3 years ago
version 2
bebc578f
2 commits,
3 years ago
version 1
6f30046c
1 commit,
3 years ago
Show latest version
1 file
+
130
−
125
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/main/jastadd/Parser.jrag
+
130
−
125
Options
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.*;
import io.swagger.v3.oas.models.servers.*;
import io.swagger.v3.oas.models.Components;
aspect Parser {
@@ -41,150 +44,152 @@ aspect Parser {
return openapi;
}
public static InfoObject InfoObject.parseInfo(Info info, Map<Object, ASTNode> map) {
InfoObject infoObject = new InfoObject();
if (info.getTitle() != null)
infoObject.setTitle(info.getTitle());
if (info.getVersion() != null)
infoObject.setVersion(info.getVersion());
if (info.getDescription() != null)
infoObject.setDescription(info.getDescription());
if (info.getTermsOfService() != null)
infoObject.setTermsOfService(info.getTermsOfService());
if (info.getContact() != null)
infoObject.setContactObject(ContactObject.parseContact(info.getContact(), map));
if (info.getLicense() != null)
infoObject.setLicenseObject(LicenseObject.parseLicense(info.getLicense(), map));
if (info.getExtensions() != null) {
for (String key : info.getExtensions().keySet())
infoObject.addExtension(new Extension(key, info.getExtensions().get(key)));
}
map.put(info, infoObject);
return infoObject;
}
public static InfoObject InfoObject.parseInfo(Info info) {
InfoObject infoObject = new InfoObject();
if (info.getTitle() != null)
infoObject.setTitle(info.getTitle());
if (info.getVersion() != null)
infoObject.setVersion(info.getVersion());
if (info.getDescription() != null)
infoObject.setDescription(info.getDescription());
if (info.getTermsOfService() != null)
infoObject.setTermsOfService(info.getTermsOfService());
if (info.getContact() != null)
infoObject.set_impl_c(ContactObject.parseContact(info.getContact()));
if (info.getLicense() != null)
infoObject.set_impl_l(LicenseObject.parseLicense(info.getLicense()));
if (info.getExtensions() != null) {
for (String key : info.getExtensions().keySet())
infoObject.addEx(new Extension(key, info.getExtensions().get(key)));
}
public static ContactObject ContactObject.parseContact(Contact contact, Map<Object, ASTNode> map){
ContactObject contactObject = new ContactObject();
/* 3.1.0 features
if (info.getSummary != null) ...
*/
if (contact.getName() != null)
contactObject.setName(contact.getName());
if (contact.getUrl() != null)
contactObject.setUrl(contact.getUrl());
if (contact.getEmail() != null)
contactObject.setEmail(contact.getEmail());
if (contact.getExtensions() != null) {
for (String key : contact.getExtensions().keySet())
contactObject.addExtension(new Extension(key, contact.getExtensions().get(key)));
}
return infoObject;
}
public static ContactObject ContactObject.parseContact(Contact contact){
ContactObject contactObject = new ContactObject();
if (contact.getName() != null)
contactObject.setName(contact.getName());
if (contact.getUrl() != null)
contactObject.setUrl(contact.getUrl());
if (contact.getEmail() != null)
contactObject.setEmail(contact.getEmail());
if (contact.getExtensions() != null) {
for (String key : contact.getExtensions().keySet())
contactObject.addEx(new Extension(key, contact.getExtensions().get(key)));
}
map.put(contact, contactObject);
return contactObject;
return contactObject;
}
public static LicenseObject LicenseObject.parseLicense(License license
, Map<Object, ASTNode> map
){
LicenseObject licenseObject = new LicenseObject();
public static LicenseObject LicenseObject.parseLicense(License license){
LicenseObject licenseObject = new LicenseObject();
if (license.getName() != null)
licenseObject.setName(license.getName());
if (license.getUrl() != null)
licenseObject.setUrl(license.getUrl());
if (license.getExtensions() != null) {
for (String key : license.getExtensions().keySet())
licenseObject.addEx
tension
(new Extension(key, license.getExtensions().get(key)));
}
if (license.getName() != null)
licenseObject.setName(license.getName());
if (license.getUrl() != null)
licenseObject.setUrl(license.getUrl());
if (license.getExtensions() != null) {
for (String key : license.getExtensions().keySet())
licenseObject.addEx(new Extension(key, license.getExtensions().get(key)));
}
map.put(license, licenseObject);
return licenseObject;
/* 3.1.0 features
if (license.getIdentifier() != null) ...
*/
return licenseObject;
}
public static ServerObject ServerObject.parseServer(Server server
, Map<Object, ASTNode> map
){
ServerObject serverObject = new ServerObject();
public static ServerObject ServerObject.parseServer(Server server){
ServerObject serverObject = new ServerObject();
if (server.getUrl() != null)
serverObject.setUrl(server.getUrl());
if (server.getDescription() != null)
serverObject.setDescription(server.getDescription());
if (server.getVariables() != null) {
for (String key : server.getVariables().keySet())
serverObject.addS
erverVariablesTuple
(new ServerVariablesTuple(key, ServerVariableObject.parseServerVariable(server.getVariable(key)
, map
)));
}
if (server.getExtensions() != null) {
for (String key : server.getExtensions().keySet())
serverObject.addEx
tension
(new Extension(key, server.getExtensions().get(key)));
}
if (server.getUrl() != null)
serverObject.setUrl(server.getUrl());
if (server.getDescription() != null)
serverObject.setDescription(server.getDescription());
if (server.getVariables() != null) {
for (String key : server.getVariables().keySet())
serverObject.addS
t
(new ServerVariablesTuple(key, ServerVariableObject.parseServerVariable(server.getVariable
s().get
(key))));
}
if (server.getExtensions() != null) {
for (String key : server.getExtensions().keySet())
serverObject.addEx(new Extension(key, server.getExtensions().get(key)));
}
map.put(server, serverObject);
return serverObject;
return serverObject;
}
public static ServerVariableObject ServerVariableObject.parseServerVariable(ServerVariable serverVariable
, Map<Object, ASTNode> map
){
ServerVariableObject serverVariableObject = new ServerVariableObject();
public static ServerVariableObject ServerVariableObject.parseServerVariable(ServerVariable serverVariable){
ServerVariableObject serverVariableObject = new ServerVariableObject();
if (serverVariable.getDefault() != null)
serverVariableObject.setDefault(serverVariable.getDefault());
if (serverVariable.getDescription() != null)
serverVariableObject.setDescription(serverVariable.getDescription());
if (serverVariable.getEnum
s
() !=
null
) {
for (String e : serverVariable.getEnum
s
())
serverVariableObject.addE
num
(new Enum(e));
}
if (serverVariable.getExtensions() != null) {
for (String key : serverVariable.getExtensions().keySet())
serverVariableObject.addEx
tension
(new Extension(key, serverVariable.getExtensions().get(key)));
}
if (serverVariable.getDefault() != null)
serverVariableObject.setDefault(serverVariable.getDefault());
if (serverVariable.getDescription() != null)
serverVariableObject.setDescription(serverVariable.getDescription());
if (serverVariable.getEnum
().size
() !=
0
) {
for (String e : serverVariable.getEnum())
serverVariableObject.addE(new Enum(e));
}
if (serverVariable.getExtensions() != null) {
for (String key : serverVariable.getExtensions().keySet())
serverVariableObject.addEx(new Extension(key, serverVariable.getExtensions().get(key)));
}
map.put(serverVariable, serverVariableObject);
return serverVariableObject;
return serverVariableObject;
}
public static ComponentsObject ComponentsObject.parseComponents(Components components
, OAIContext context, Map<Object, ASTNode> map) throws DecodeException
{
ComponentsObject componentsObject = new ComponentsObject();
public static ComponentsObject ComponentsObject.parseComponents(Components components
)
{
ComponentsObject componentsObject = new ComponentsObject();
if (components.getSchemas() != null) {
for (String key : components.getSchemas().keySet())
componentsObject.addS
chemaTuple
(new SchemaTuple(key, SchemaOb.parseSchema(components.getSchema
(key), context, map
)));
}
if (components.getResponses() != null) {
for (String key : components.getResponses().keySet())
componentsObject.addR
esponseTuple
(new ResponseTuple(key, ResponseOb.parseResponse(components.getResponse
(key), context, map
)));
}
if (components.getParameters() != null) {
for (String key : components.getParameters().keySet())
componentsObject.addP
arameterTuple
(new ParameterTuple(key, ParameterOb.parseParameter(components.getParameter
(key), context, map
)));
}
if (components.getExamples() != null) {
for (String key : components.getExamples().keySet())
componentsObject.addE
xampleTuple
(new ExampleTuple(key, ExampleObject.parseExample(components.getExample
(key), context, map
)));
}
if (components.getRequestBodies() != null) {
for (String key : components.getRequestBodies().keySet())
componentsObject.addR
equestBodyTuple
(new RequestBodyTuple(key, RequestBodyOb.parseRequestBody(components.getRequestBod
y(key), context, map
)));
}
if (components.getHeaders() != null) {
for (String key : components.getHeaders().keySet())
componentsObject.addH
eaderTuple
(new HeaderTuple(key, HeaderOb.parseHeader(components.getHeader
(key), context, map
)));
}
if (components.getSecuritySchemes() != null) {
for (String key : components.getSecuritySchemes().keySet())
componentsObject.addS
ecuritySchemeTuple
(new SecuritySchemeTuple(key, SecuritySchemeOb.parseSecurityScheme(components.getSecurityScheme
(key), context, map
)));
}
if (components.getLinks() != null) {
for (String key : components.getLinks().keySet())
componentsObject.addL
inkTuple
(new LinkTuple(key, LinkOb.parseLink(components.getLink
(key), context, map
)));
}
if (components.getCallbacks() != null) {
for (String key : components.getCallbacks().keySet())
componentsObject.addC
allbackTuple
(new CallbackTuple(key, CallbackOb.parseCallback(components.getCallback
(key), context, map
)));
}
if (components.getExtensions() != null) {
for (String key : components.getExtensions().keySet())
componentsObject.addEx
tension
(new Extension(key, components.getExtensions().get(key)));
}
if (components.getSchemas() != null) {
for (String key : components.getSchemas().keySet())
componentsObject.addS(new SchemaTuple(key, SchemaOb.parseSchema(components.getSchema
s().get(key)
)));
}
if (components.getResponses() != null) {
for (String key : components.getResponses().keySet())
componentsObject.addR(new ResponseTuple(key, ResponseOb.parseResponse(components.getResponse
s().get(key)
)));
}
if (components.getParameters() != null) {
for (String key : components.getParameters().keySet())
componentsObject.addP(new ParameterTuple(key, ParameterOb.parseParameter(components.getParameter
s().get(key)
)));
}
if (components.getExamples() != null) {
for (String key : components.getExamples().keySet())
componentsObject.addE(new ExampleTuple(key, ExampleObject.parseExample(components.getExample
s().get(key)
)));
}
if (components.getRequestBodies() != null) {
for (String key : components.getRequestBodies().keySet())
componentsObject.addR
b
(new RequestBodyTuple(key, RequestBodyOb.parseRequestBody(components.getRequestBod
ies().get(key)
)));
}
if (components.getHeaders() != null) {
for (String key : components.getHeaders().keySet())
componentsObject.addH(new HeaderTuple(key, HeaderOb.parseHeader(components.getHeader
s().get(key)
)));
}
if (components.getSecuritySchemes() != null) {
for (String key : components.getSecuritySchemes().keySet())
componentsObject.addS
c
(new SecuritySchemeTuple(key, SecuritySchemeOb.parseSecurityScheme(components.getSecurityScheme
s().get(key)
)));
}
if (components.getLinks() != null) {
for (String key : components.getLinks().keySet())
componentsObject.addL(new LinkTuple(key, LinkOb.parseLink(components.getLink
s().get(key)
)));
}
if (components.getCallbacks() != null) {
for (String key : components.getCallbacks().keySet())
componentsObject.addC(new CallbackTuple(key, CallbackOb.parseCallback(components.getCallback
s().get(key)
)));
}
if (components.getExtensions() != null) {
for (String key : components.getExtensions().keySet())
componentsObject.addEx(new Extension(key, components.getExtensions().get(key)));
}
map.put(components, componentsObject);
return componentsObject;
return componentsObject;
}
public static PathItemObject PathItemObject.parsePath(Path path, OAIContext context, Map<Object, ASTNode> map) throws DecodeException {
Loading