forked from quarkusio/quarkus-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect endpoint encoders/decoders for path parameters
`PathParameters` could only make use of the default encoding factory, which allows primitive and String types. With this change, custom encoders/decoders are considered, too. Fixes quarkusioGH-52
- Loading branch information
1 parent
8403f58
commit 7c93d8e
Showing
4 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
websockets-jsr/src/test/java/io/undertow/websockets/jsr/test/annotated/UuidEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2014 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.undertow.websockets.jsr.test.annotated; | ||
|
||
import javax.websocket.EndpointConfig; | ||
import javax.websocket.OnMessage; | ||
import javax.websocket.OnOpen; | ||
import javax.websocket.Session; | ||
import javax.websocket.server.PathParam; | ||
import javax.websocket.server.ServerEndpoint; | ||
import java.util.UUID; | ||
|
||
@ServerEndpoint("/uuid/{id}") | ||
public class UuidEndpoint { | ||
|
||
UUID id; | ||
|
||
@OnOpen | ||
public void open(Session session, EndpointConfig config, @PathParam("id") UUID id) { | ||
this.id = id; | ||
} | ||
|
||
@OnMessage | ||
public String handleMessage(String message) { | ||
return message + id; | ||
} | ||
|
||
} |