Adding header example causes API specification download error
See original GitHub issueThe issue occurs when you add a response header, and then an example to the response header. I used the petstore api to test this. This was the output:
apicurio-studio-ui_1 | 2021-08-27 08:56:00,550 DEBUG [io.apicurio.studio.fe.servlet.servlets.PreviewServlet] (default task-1) Rendering document preview for API: 3
apicurio-studio-ui_1 | 2021-08-27 08:56:00,550 DEBUG [io.apicurio.studio.fe.servlet.servlets.PreviewServlet] (default task-1) Spec URL: download?type=api&format=json&dereference=true&id=3
apicurio-studio-ui_1 | 2021-08-27 08:56:00,924 DEBUG [io.apicurio.studio.shared.config.Configuration] (default task-1) Config Property: APICURIO_UI_HUB_API_URL/apicurio-ui.hub-api.url = http://192.168.211.138:8091
apicurio-studio-api_1 | 2021-08-27 08:56:00,929 DEBUG [io.apicurio.hub.api.rest.impl.DesignsResource] (default task-27) Getting content for API design with ID: 3
apicurio-studio-api_1 | 2021-08-27 08:56:00,929 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-27) Selecting a single API Design: 3
apicurio-studio-api_1 | 2021-08-27 08:56:00,931 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-27) Selecting the most recent api_content row of type 'document' for: 3
apicurio-studio-api_1 | 2021-08-27 08:56:00,933 DEBUG [io.apicurio.hub.core.storage.jdbc.JdbcStorage] (default task-27) Selecting the content 'command' rows for API 3 since content version 371
apicurio-studio-api_1 | 2021-08-27 08:56:00,935 INFO [io.apicurio.hub.core.cmd.OaiCommandExecutor] (default task-27) Applying 3 commands to a document.
apicurio-studio-api_1 | 2021-08-27 08:56:00,936 INFO [stdout] (default task-27) |INFO| [NewHttpHeaderCommand] Executing.
apicurio-studio-api_1 | 2021-08-27 08:56:00,937 INFO [stdout] (default task-27) |INFO| [ChangeHeaderTypeCommand] Executing.
apicurio-studio-api_1 | 2021-08-27 08:56:00,938 INFO [stdout] (default task-27) |INFO| [AddExampleCommand_30] Executing.
apicurio-studio-api_1 | 2021-08-27 08:56:00,938 ERROR [io.undertow.request] (default task-27) UT005023: Exception handling request to /designs/3/content: org.jboss.resteasy.spi.UnhandledException: java.lang.ClassCastException: class io.apicurio.datamodels.openapi.v3.models.Oas30Header cannot be cast to class io.apicurio.datamodels.openapi.v3.models.Oas30MediaType (io.apicurio.datamodels.openapi.v3.models.Oas30Header and io.apicurio.datamodels.openapi.v3.models.Oas30MediaType are in unnamed module of loader 'deployment.apicurio-studio-api.war' @16210d3)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:82)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:346)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:193)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:457)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:229)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:135)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:138)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:215)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
apicurio-studio-api_1 | at javax.servlet.api@2.0.0.Final//javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.api.security.KeycloakAuthenticationFilter.doFilter(KeycloakAuthenticationFilter.java:72)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.api.filters.DisableCachingFilter.doFilter(DisableCachingFilter.java:66)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.api.filters.CorsFilter.doFilter(CorsFilter.java:64)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apicurio-studio-api_1 | at org.keycloak.keycloak-undertow-adapter@9.0.3//org.keycloak.adapters.undertow.UndertowAuthenticatedActionsHandler.handleRequest(UndertowAuthenticatedActionsHandler.java:66)
apicurio-studio-api_1 | at org.wildfly.swarm.keycloak:deployment@2.7.0.Final//org.wildfly.swarm.keycloak.deployment.SecurityContextServletExtension.lambda$null$0(SecurityContextServletExtension.java:40)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//org.wildfly.swarm.generated.FaviconErrorHandler.handleRequest(FaviconErrorHandler.java:61)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:91)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
apicurio-studio-api_1 | at org.keycloak.keycloak-undertow-adapter@9.0.3//org.keycloak.adapters.undertow.ServletPreAuthActionsHandler.handleRequest(ServletPreAuthActionsHandler.java:69)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
apicurio-studio-api_1 | at org.wildfly.extension.undertow@18.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
apicurio-studio-api_1 | at org.wildfly.swarm.keycloak:deployment@2.7.0.Final//org.wildfly.swarm.keycloak.deployment.KeycloakThreadSetupHandler.lambda$create$0(KeycloakThreadSetupHandler.java:35)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
apicurio-studio-api_1 | at io.undertow.servlet@2.1.3.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:370)
apicurio-studio-api_1 | at io.undertow.core@2.1.3.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
apicurio-studio-api_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
apicurio-studio-api_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
apicurio-studio-api_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
apicurio-studio-api_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
apicurio-studio-api_1 | at java.base/java.lang.Thread.run(Thread.java:829)
apicurio-studio-api_1 | Caused by: java.lang.ClassCastException: class io.apicurio.datamodels.openapi.v3.models.Oas30Header cannot be cast to class io.apicurio.datamodels.openapi.v3.models.Oas30MediaType (io.apicurio.datamodels.openapi.v3.models.Oas30Header and io.apicurio.datamodels.openapi.v3.models.Oas30MediaType are in unnamed module of loader 'deployment.apicurio-studio-api.war' @16210d3)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.datamodels.cmd.commands.AddExampleCommand_30.execute(AddExampleCommand_30.java:86)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.core.cmd.OaiCommandExecutor.lambda$executeCommands$0(OaiCommandExecutor.java:67)
apicurio-studio-api_1 | at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.core.cmd.OaiCommandExecutor.executeCommands(OaiCommandExecutor.java:65)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.core.cmd.OaiCommandExecutor$Proxy$_$$_WeldClientProxy.executeCommands(Unknown Source)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.api.rest.impl.DesignsResource.getContent(DesignsResource.java:618)
apicurio-studio-api_1 | at deployment.apicurio-studio-api.war//io.apicurio.hub.api.rest.impl.DesignsResource$Proxy$_$$_WeldClientProxy.getContent(Unknown Source)
apicurio-studio-api_1 | at jdk.internal.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
apicurio-studio-api_1 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
apicurio-studio-api_1 | at java.base/java.lang.reflect.Method.invoke(Method.java:566)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:138)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:535)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:424)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:385)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:387)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:356)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:329)
apicurio-studio-api_1 | at org.jboss.resteasy.resteasy-jaxrs@3.11.2.Final//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:440)
apicurio-studio-api_1 | ... 71 more
apicurio-studio-api_1 |
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
API Headers - What Are They? Examples & More [Explained]
API headers represent the meta-data associated with an API request and response. In other words, they're like an extra source of information for...
Read more >How To Fix HTTP Error 431 Request Header Fields Too Large
The number 431 indicates the specific HTTP error, which is “Request Header Fields Too Large.” Essentially, this means that the HTTP request ...
Read more >Troubleshoot a "Request header too large" message or 400 ...
The "Request header too large" message is thrown with an HTTP error code 400. This error occurs if the size of the request...
Read more >Error: "{"code": "INVALID_EXAMPLE_NAME", "message": "No ...
When Try-out the API Specs through the Mocking Service, the following error occurs: "{"code": "INVALID_EXAMPLE_NAME", "message": "No example ...
Read more >HTTP headers and query string parameters for XML API
A request and response header that specifies the compression algorithm for an object. Valid Values, Any valid compression algorithm (see the specification).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just realized that we aren’t pushing the
latest-snapshot
docker image. So the bad news is that currently I think you need to wait for a release unless you want to build the docker image(s) locally.@riprasad can you look into updating the Studio GH workflows to make sure we push
latest-snapshot
(same as we do for registry) with every successful build offmaster
?@schelv in addition I will do a new upstream release once I get a few outstanding PRs merged.
I’m running the whole thing using docker-compose. How can I update it to use the version with the bug fix? Is a docker-compose pull enough? If so when will the image with the bug fix be released?