mulesoft-labs / raml-for-jax-rs

This project is all about two way transformation of JAX-RS-annotated Java code to RAML API description and back.
Other
296 stars 181 forks source link

String patterns not recognized in jaxrs Path #418

Open Kaiser1989 opened 4 years ago

Kaiser1989 commented 4 years ago

Given following raml:

#%RAML 1.0
title: GitHub API
version: v3
baseUri: https://api.github.com
/ViewingSession:
  /{viewingSessionId}:
    /Attachments:
      uriParameters:
        viewingSessionId:
          type: string
          pattern: ^(;[^/;]+)*$
      put:

should create a path like:

@Path("/ViewingSession/{viewingSessionId:(;[^/;]+)*}/Attachments)

The regex is not shown in path attribute. I added a pull request that fixes this problem (added a unit test under ResourceBuilderTestV10.java)

jpbelang commented 4 years ago

I'll check it tonight.

jpbelang commented 4 years ago

Side note from the spec: regexp in RAML are Ecma regexp. There are some differences with java regexp. It not have any real impact in your application.