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
52 commits
Select commit Hold shift + click to select a range
511058e
Adds generateSecuritySchemes method, unfinished
spacether Feb 26, 2023
2f5a32a
Adds security_schemes.py main module
spacether Feb 26, 2023
9b52856
Updates java classes that store security scheme data
spacether Feb 26, 2023
13f7ac5
Adds CodegenSecurityRequirement
spacether Feb 26, 2023
80467f6
Adds security to operation
spacether Feb 27, 2023
bdaef82
Uses fromSecurityRequirement in operation
spacether Feb 27, 2023
3184444
Fixes java creation of securityRequiremnts
spacether Feb 27, 2023
086571c
Sample regen, breaks auth
spacether Feb 27, 2023
953a2db
renders security imports in operations
spacether Feb 27, 2023
a04e859
Removes extra newlines by imports
spacether Feb 28, 2023
d05d2de
Adds java code to generate security schemes
spacether Feb 28, 2023
40c5927
Fixes security schemes init file
spacether Mar 1, 2023
188eb3b
Gnerates one file for each component security scheme
spacether Mar 1, 2023
28fd449
Simplifies java file generation
spacether Mar 1, 2023
a1c62cd
Uses generateXs in generateHeader
spacether Mar 1, 2023
e82848a
Uses generateXs in parameter generation
spacether Mar 1, 2023
11a78cc
Uses generateXs in all locations
spacether Mar 1, 2023
158785a
Dedents some code
spacether Mar 1, 2023
80c897b
Adds description to security scheme classes
spacether Mar 1, 2023
f326d0a
Adds full rendering of component security scheme
spacether Mar 1, 2023
e82ae5b
Adds SecurityRequirementObject
spacether Mar 1, 2023
d2136e8
Adds security schemes section to readme
spacether Mar 2, 2023
a23921a
Adds some java code to standardize docs generation for components
spacether Mar 2, 2023
f59dbd4
Generates schema docs using new method
spacether Mar 2, 2023
0d924a3
Removes header doc methods and properties
spacether Mar 2, 2023
25f9cb5
Removes parameter docs methods and properties
spacether Mar 2, 2023
a04db94
Simplifies request body doc generation
spacether Mar 2, 2023
76b3c79
Simplifes response doc generation
spacether Mar 2, 2023
19e9082
Adds doc generation for security schemes
spacether Mar 2, 2023
af0484d
Updates securty scheme docs
spacether Mar 2, 2023
8c74fca
Fixes section link for security schemes
spacether Mar 2, 2023
a470215
Updates SecurityRequiremntObject
spacether Mar 2, 2023
7ca9441
Isolates auth application to security scheme class
spacether Mar 3, 2023
e845195
Fixes readme link for component schemas, fixes crypto install
spacether Mar 3, 2023
7f54502
Fixes dataclass prop order, makes some base classes private
spacether Mar 3, 2023
36ac367
Fixes security shcem class defaults
spacether Mar 3, 2023
b307ab4
Fixes two tests
spacether Mar 3, 2023
4e39a2e
Removes commented out filtering code
spacether Mar 3, 2023
53eafc9
Fixes basic auth test
spacether Mar 3, 2023
90e7f3e
Adds auth to fix test
spacether Mar 3, 2023
cf730c6
Fixes last broken test
spacether Mar 3, 2023
9ae8d44
Updates doc schema ref links
spacether Mar 3, 2023
8df3937
Adds __SecuritySchemeBase
spacether Mar 3, 2023
dc4e8ac
Fixes java test
spacether Mar 3, 2023
1df0dee
Samples regenerated
spacether Mar 3, 2023
e1677a5
Samples regen
spacether Mar 3, 2023
886029a
Improves endpoint docs
spacether Mar 4, 2023
b67d603
Adds total false to the auth info class definition
spacether Mar 5, 2023
23bbfd8
CHanges bearer_token to access_token
spacether Mar 6, 2023
cbee717
Removes auth info from the Configuration docstring
spacether Mar 6, 2023
d771a8e
Adds security into to endpoint docs
spacether Mar 6, 2023
2801237
Samples updated
spacether Mar 6, 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 @@ -25,6 +25,7 @@
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.parameters.RequestBody;
import io.swagger.v3.oas.models.responses.ApiResponse;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
Expand All @@ -35,7 +36,8 @@
import org.openapijsonschematools.codegen.model.CodegenRequestBody;
import org.openapijsonschematools.codegen.model.CodegenResponse;
import org.openapijsonschematools.codegen.model.CodegenSchema;
import org.openapijsonschematools.codegen.model.CodegenSecurity;
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;
Expand All @@ -44,6 +46,7 @@
import org.openapijsonschematools.codegen.meta.GeneratorMetadata;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -86,22 +89,12 @@ public interface CodegenConfig {

String modelTestFileFolder();

String modelDocFileFolder();

String requestBodyDocFileFolder();

String headerDocFileFolder();

String parameterDocFileFolder();

String modelPackage();

String modelPackagePathFragment();

String packageName();

String responseDocFileFolder();

String toApiName(String name);

String toApiVarName(String name);
Expand Down Expand Up @@ -144,7 +137,9 @@ public interface CodegenConfig {

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

List<CodegenSecurity> fromSecurity(Map<String, SecurityScheme> schemas);
CodegenSecurityScheme fromSecurityScheme(SecurityScheme securityScheme, String jsonPath);

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

List<CodegenServer> fromServers(List<Server> servers);

Expand All @@ -168,26 +163,18 @@ public interface CodegenConfig {

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

Map<String, String> requestBodyDocTemplateFiles();

Map<String, String> headerDocTemplateFiles();

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

Set<String> pathEndpointTestTemplateFiles();

Set<String> pathEndpointDocTemplateFiles();

Map<String, String> responseDocTemplateFiles();

Map<String, String> apiTestTemplateFiles();

Map<String, String> modelTestTemplateFiles();

Map<String, String> apiDocTemplateFiles();

Map<String, String> modelDocTemplateFiles();

Set<String> languageSpecificPrimitives();

Map<String, String> reservedWordsMappings();
Expand All @@ -212,23 +199,15 @@ public interface CodegenConfig {

String toApiDocFilename(String name);

String toModelDocFilename(String name);

String toRequestBodyFilename(String componentName);

String toRequestBodyDocFilename(String componentName);

String toResponseDocFilename(String componentName);

String toHeaderDocFilename(String componentName);

String toHeaderFilename(String componentName);

String toPathFilename(String path);

String toParameterFilename(String baseName);

String toParameterDocFilename(String componentName);
String toSecuritySchemeFilename(String baseName);

String toModelImport(String refClass);

Expand All @@ -255,6 +234,8 @@ public interface CodegenConfig {
// handles almost all files to be written
String getFilepath(String jsonPath);

String getDocsFilepath(String jsonPath);

String apiFilename(String templateName, String tag);

String apiTestFilename(String templateName, String tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class CodegenConstants {
public static final String REQUEST_BODY_DOCS = "requestBodyDocs";

public static final String RESPONSES = "responses";
public static final String RESPONSE_DOCS = "responseDocs";

public static final String COMPONENTS = "components";

Expand All @@ -38,6 +39,9 @@ public class CodegenConstants {

public static final String PARAMETERS = "parameters";

public static final String SECURITY_SCHEMES = "securitySchemes";
public static final String SECURITY_SCHEME_DOCS = "securitySchemeDocs";

public static final String PARAMETER_DOCS = "parameterDocs";
public static final String SUPPORTING_FILES = "supportingFiles";
public static final String MODEL_TESTS = "modelTests";
Expand Down Expand Up @@ -238,7 +242,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}
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 MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original}

Expand Down
Loading