F gpu 2196 - #1750
Conversation
| @JsonProperty(required = false) | ||
| @JsonPropertyDescription("Should the endpoints of the included plugins be excluded from the OpenAPI specification generation requests. Default is true.") | ||
| @EnvironmentVariable(name = MESH_OPENAPI_EXCLUDE_PLUGINS_ENV, description = "Override the flag to exclude endpoints of the plugins from the OpenAPI specification generation requests") | ||
| private boolean openapiExcludePlugins = true; |
There was a problem hiding this comment.
Should we exclude plugins by default?
| revokePermissionsEndpoint.exampleRequest(roleExamples.getObjectPermissionRevokeRequest(includePublishPermissions)); | ||
| revokePermissionsEndpoint.exampleResponse(OK, roleExamples.getObjectPermissionResponse(includePublishPermissions), "Updated permissions."); | ||
| revokePermissionsEndpoint.events(ROLE_PERMISSIONS_CHANGED); | ||
| revokePermissionsEndpoint.setHidden(true); |
There was a problem hiding this comment.
DELETE request with a body are not allowed in the v3.0 specification, so while the direct http calls will still work, we hide this from the generator and redefine an identical PUT request below.
| * @throws OpenAPIGenerationException | ||
| */ | ||
| public void run() throws IOException, OpenAPIGenerationException { | ||
| String yaml = generate("yaml"); |
There was a problem hiding this comment.
Generate yaml to be consistent with RAML generator output.
| }, isOrderedBlockingHandlers()); | ||
|
|
||
| InternalEndpointRoute readEndpoint = createRoute(); | ||
| readEndpoint.path("/plugins/:uuid"); |
|
|
||
| secure("/"); | ||
| InternalEndpointRoute infoEndpoint = createRoute(); | ||
| infoEndpoint.setInsecure(true); |
There was a problem hiding this comment.
Is actually accessible with no auth, giving back different info for anonymous user.
| crudHandler.handleSetLatest(ac, uuid); | ||
| }, isOrderedBlockingHandlers()); | ||
|
|
||
| InternalEndpointRoute upsertBranch = createRoute(); |
There was a problem hiding this comment.
Here we explicitly tell apart update and upsert EPs for all models, since the specification requires different body models for create and update actions. The backwards compatibility is kept.
| revokePermissionsEndpoint.exampleResponse(OK, roleExamples.getObjectPermissionResponse(false), "Updated permissions."); | ||
| revokePermissionsEndpoint.events(ROLE_PERMISSIONS_CHANGED); | ||
| revokePermissionsEndpoint.blockingHandler(rc -> { | ||
| InternalEndpointRoute revokePermissionsEndpointNonStandard = createRoute(); |
There was a problem hiding this comment.
DELETE method with a body is not allowed by a spec.
| import java.util.stream.Stream; | ||
|
|
||
| import org.codehaus.jettison.json.JSONException; | ||
| import org.codehaus.jettison.json.JSONObject; |
There was a problem hiding this comment.
Using other JSON implementation is awkward.
| } | ||
| config.setInstanceName(options.getNodeName()); | ||
| config.setClusterName(options.getClusterOptions().getClusterName()); | ||
| config.setClusterName(Optional.ofNullable(options.getClusterOptions().getClusterName()).orElseGet(() -> options.getNodeName())); |
| String format = formatConf.name().toLowerCase(); | ||
|
|
||
| // Collect available servers | ||
| HttpServerConfig httpServerConfig = options.getHttpServerOptions(); |
There was a problem hiding this comment.
Can be reverted, if considered a vulnerability.
| defaultMapper = JsonMapper.builder(new JsonFactoryBuilder() | ||
| .streamReadConstraints(StreamReadConstraints.builder().maxStringLength(Integer.MAX_VALUE).build()) | ||
| .build()) | ||
| .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS) |
There was a problem hiding this comment.
Already used (at least) in the tests, so formalized for the model generation.
| @@ -26,6 +26,6 @@ default BackupParameters setConsistencyCheck(boolean flag) { | |||
| * @return | |||
| */ | |||
| default boolean isConsistencyCheck() { | |||
There was a problem hiding this comment.
Null values were improperly processed with valueOf.
| import io.vertx.core.json.JsonObject; | ||
|
|
||
| /** | ||
| * An upgrade to the generated DefaultAPI, overriding its generation problems |
There was a problem hiding this comment.
Even though the text/* string body is defined for the method in the spec, okhttp3-gson client generator forgets about it.
Abstract
Checklist
General
/CHANGELOG.adocOn API Changes