Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0d64919
Adds servers template, replaces codegenservervariable with codegenschema
spacether Mar 7, 2023
a6fa990
Adds servers init
spacether Mar 8, 2023
62417a3
Adds configuration server_info
spacether Mar 8, 2023
0133192
Server key prefix converted to stirng
spacether Mar 9, 2023
ad84aa5
Consolidates path + pathItem generation
spacether Mar 9, 2023
4046d09
petstore regen
spacether Mar 9, 2023
3e6f637
Updated data passed into operation test template
spacether Mar 10, 2023
b6419f6
Fixes passing through the host property in endpoint calls, fixes some…
spacether Mar 11, 2023
5b2e9fe
Adds needed pass line to simple schema generation in stub files
spacether Mar 11, 2023
9c36efd
Removes extra new lines from server files
spacether Mar 11, 2023
b1bbf18
Fixes python tests
spacether Mar 12, 2023
688fa26
fixes server filenames in path item
spacether Mar 13, 2023
e46f516
Fixes server name generation on endpoint servers
spacether Mar 13, 2023
e373c45
Always passes in server_index
spacether Mar 13, 2023
7faf51a
Adds test_path_servers
spacether Mar 13, 2023
e004f05
Separates out configuration classses, fixes python tests
spacether Mar 14, 2023
dddb7f8
Moves operation into non init python file, updates path to api gneration
spacether Mar 14, 2023
e7a32fd
Fixes tag_to_api generation
spacether Mar 14, 2023
2a39cad
Adds path api generation
spacether Mar 14, 2023
af87751
Adds api tag generation
spacether Mar 15, 2023
2a6a72a
Fixes 3 tests
spacether Mar 15, 2023
64cd299
Fixes python tests
spacether Mar 15, 2023
2a17e07
Adds all server info to api configuration
spacether Mar 15, 2023
bc431e9
Removes unused methods and properties
spacether Mar 15, 2023
776658c
Adds test_operation_servers
spacether Mar 15, 2023
fe9770b
Removes basePath, basePathWithoutHost, host, port
spacether Mar 15, 2023
495352b
Removes unneeded java classes, simplifies readme endpoints generation
spacether Mar 15, 2023
09c0b27
Removes parameter from bundle
spacether Mar 15, 2023
09b0882
Makes readme author section conditional, adds servers section, fixes …
spacether Mar 15, 2023
ef94430
Adds code example back into readme
spacether Mar 15, 2023
ddd4af9
Fixes ref schema doc links
spacether Mar 15, 2023
e366b44
Adds root server docs
spacether Mar 16, 2023
dab68e2
Removes pathEndpointDocTemplateFiles
spacether Mar 17, 2023
0f5fef6
Fixes parameter schema anchors in endpoint docs
spacether Mar 17, 2023
f1bb048
Fixes schema refs in endpoints
spacether Mar 17, 2023
cc595c2
Adds server info to operation docs
spacether Mar 18, 2023
4c64a1e
Adds pathItem servers to operation docs
spacether Mar 18, 2023
176db50
Always adds Arguments and Servers sections to endpoint docs
spacether Mar 18, 2023
6a570df
Adds server info and defaults to endpoint docs
spacether Mar 19, 2023
403dae5
Removes responses prefix from endpoint docs
spacether Mar 19, 2023
1d2fd08
Adds working links for response classes
spacether Mar 19, 2023
72ba946
Fixes some java test syntax errors
spacether Mar 19, 2023
b3670ff
Fixes more java test signature issues
spacether Mar 19, 2023
1daa8bc
Fixes more java test signature issues
spacether Mar 20, 2023
5edf628
Adds missing java templates back in
spacether Mar 20, 2023
4eb124b
Removes callback test
spacether Mar 20, 2023
569ace7
Standardizes api file path generation
spacether Mar 21, 2023
48f1546
Fixes one java test
spacether Mar 21, 2023
23e1683
Generates api docs for each tag api
spacether Mar 21, 2023
d0f133b
Fixes operationId endpoint order in api docs
spacether Mar 21, 2023
191a6e7
Fixes readme link to api docs
spacether Mar 21, 2023
bb54704
Adds tag description to api docs
spacether Mar 21, 2023
f79e518
Fixes java test
spacether Mar 22, 2023
b4d486f
Fixes java test
spacether Mar 22, 2023
99449a9
FIxes java test
spacether Mar 22, 2023
8d3a703
Fixes testDateTimeFormParameterHasDefaultValue
spacether Mar 22, 2023
3f8313b
Fixes testLeadingSlashIsAddedIfMissing
spacether Mar 22, 2023
e23a171
Docs regenerated
spacether Mar 22, 2023
f264d9f
Regens sampless with fixed config imports
spacether Mar 22, 2023
6d414d4
Fixes tests in unit test spec
spacether Mar 22, 2023
d4dceda
Samples regenerated
spacether Mar 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.samskivert.mustache.Mustache.Compiler;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem;
import io.swagger.v3.oas.models.Paths;
import io.swagger.v3.oas.models.headers.Header;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.parameters.Parameter;
Expand All @@ -30,20 +32,21 @@
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import org.openapijsonschematools.codegen.model.CodegenHeader;
import org.openapijsonschematools.codegen.model.CodegenKey;
import org.openapijsonschematools.codegen.model.CodegenOperation;
import org.openapijsonschematools.codegen.model.CodegenParameter;
import org.openapijsonschematools.codegen.model.CodegenPathItem;
import org.openapijsonschematools.codegen.model.CodegenPatternInfo;
import org.openapijsonschematools.codegen.model.CodegenRequestBody;
import org.openapijsonschematools.codegen.model.CodegenResponse;
import org.openapijsonschematools.codegen.model.CodegenSchema;
import org.openapijsonschematools.codegen.model.CodegenSecurityRequirementValue;
import org.openapijsonschematools.codegen.model.CodegenSecurityScheme;
import org.openapijsonschematools.codegen.model.CodegenServer;
import org.openapijsonschematools.codegen.model.CodegenServerVariable;
import org.openapijsonschematools.codegen.model.OperationsMap;
import org.openapijsonschematools.codegen.api.TemplatingEngineAdapter;
import org.openapijsonschematools.codegen.meta.FeatureSet;
import org.openapijsonschematools.codegen.meta.GeneratorMetadata;
import org.openapijsonschematools.codegen.model.CodegenTag;

import java.io.File;
import java.util.HashMap;
Expand Down Expand Up @@ -135,15 +138,23 @@ public interface CodegenConfig {

CodegenSchema fromSchema(Schema<?> schema, String sourceJsonPath, String currentJsonPath);

CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, List<Server> servers);
CodegenTag fromTag(String name, String description);

CodegenOperation fromOperation(Operation operation, String jsonPath);

CodegenKey getKey(String key);

CodegenSecurityScheme fromSecurityScheme(SecurityScheme securityScheme, String jsonPath);

HashMap<String, CodegenSecurityRequirementValue> fromSecurityRequirement(SecurityRequirement securityScheme, String jsonPath);

List<CodegenServer> fromServers(List<Server> servers);
TreeMap<CodegenKey, CodegenPathItem> fromPaths(Paths paths);

CodegenPathItem fromPathItem(PathItem pathItem, String jsonPath);

List<CodegenServer> fromServers(List<Server> servers, String jsonPath);

List<CodegenServerVariable> fromServerVariables(Map<String, ServerVariable> variables);
HashMap<CodegenKey, CodegenSchema> fromServerVariables(Map<String, ServerVariable> variables, String jsonPath);

Map<String, String> typeMapping();

Expand All @@ -157,24 +168,16 @@ public interface CodegenConfig {

Map<String, String> inlineSchemaNameDefault();

Map<String, String> apiTemplateFiles();
HashMap<CodegenConstants.JSON_PATH_LOCATION_TYPE, HashMap<String, String>> jsonPathTemplateFiles();

Map<String, String> apiXToApiTemplateFiles();

Map<CodegenConstants.JSON_PATH_LOCATION_TYPE, Map<String, String>> jsonPathTemplateFiles();

Map<CodegenConstants.JSON_PATH_LOCATION_TYPE, Map<String, String>> jsonPathDocTemplateFiles();
HashMap<CodegenConstants.JSON_PATH_LOCATION_TYPE, HashMap<String, String>> jsonPathDocTemplateFiles();

Set<String> pathEndpointTestTemplateFiles();

Set<String> pathEndpointDocTemplateFiles();

Map<String, String> apiTestTemplateFiles();

Map<String, String> modelTestTemplateFiles();

Map<String, String> apiDocTemplateFiles();

Set<String> languageSpecificPrimitives();

Map<String, String> reservedWordsMappings();
Expand Down Expand Up @@ -209,6 +212,10 @@ public interface CodegenConfig {

String toSecuritySchemeFilename(String baseName);

String toServerFilename(String baseName);

String getCamelCaseServer(String baseName);

String toModelImport(String refClass);

Map<String, String> toModelImportMap(String name);
Expand All @@ -225,8 +232,6 @@ public interface CodegenConfig {

TreeMap<String, CodegenSchema> postProcessModels(TreeMap<String, CodegenSchema> models);

OperationsMap postProcessOperationsWithModels(OperationsMap operations, TreeMap<String, CodegenSchema> schemas);

Map<String, Object> postProcessSupportingFileData(Map<String, Object> data);

void postProcessModelProperty(CodegenSchema model, CodegenSchema property);
Expand All @@ -236,12 +241,8 @@ public interface CodegenConfig {

String getDocsFilepath(String jsonPath);

String apiFilename(String templateName, String tag);

String apiTestFilename(String templateName, String tag);

String apiDocFilename(String templateName, String tag);

boolean isSkipOverwrite();

void setSkipOverwrite(boolean skipOverwrite);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
public class CodegenConstants {
/* System Properties */
// NOTE: We may want to move these to a separate class to avoid confusion or modification.
public static final String SERVERS = "servers";
public static final String APIS = "apis";
public static final String MODELS = "models";
public static final String CONTENT = "content";
Expand Down Expand Up @@ -242,7 +243,7 @@ public class CodegenConstants {

public static enum PARAM_NAMING_TYPE {camelCase, PascalCase, snake_case, original}

public static enum JSON_PATH_LOCATION_TYPE {SCHEMA, REQUEST_BODY, PARAMETER, RESPONSE, HEADER, CONTENT, CONTENT_TYPE, HEADERS, PARAMETERS, RESPONSES, REQUEST_BODIES, SCHEMAS, PATHS, PATH, COMPONENTS, OPERATION, SECURITY_SCHEMES, SECURITY_SCHEME}
public static enum JSON_PATH_LOCATION_TYPE {SCHEMA, REQUEST_BODY, PARAMETER, RESPONSE, HEADER, CONTENT, CONTENT_TYPE, HEADERS, PARAMETERS, RESPONSES, REQUEST_BODIES, SCHEMAS, PATHS, PATH, COMPONENTS, OPERATION, SECURITY_SCHEMES, SECURITY_SCHEME, SERVERS, SERVER, API_ROOT_FOLDER, API_PATH, API_TAG, API_PATHS, API_TAGS}

public static enum MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original}

Expand Down
Loading