Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

'version' not appending in jax-rs @Path #442

@kumarrajnumber

Description

@kumarrajnumber

Hi,

'version' is not appending in jax-rs generated classes @path

my raml file, rename it to .raml
https://github.com/mulesoft-labs/raml-for-jax-rs/files/4598660/api.txt

I was expecting @Path("/v1/user") instead it created without version in path @Path("/user")
Even 'baseUri' is ignored.
It would be difficult if RAML provider changes the api version to v2. Suggestions please.

output:

@Path("/user")
public interface User {
  /**
   */
  @POST
  @Path("/activation")
  @Consumes("application/json")
  PostUserActivationResponse postUserActivation(
      @NotNull @Valid UserActivationPostApplicationJson entity);

  class PostUserActivationResponse extends ResponseDelegate {....}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.company.project</groupId>
    <artifactId>Simulator</artifactId>
    <version>1.0-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>2.0.1.Final</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.raml.jaxrs</groupId>
                <artifactId>raml-to-jaxrs-maven-plugin</artifactId>
                <version>3.0.7</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.raml.jaxrs</groupId>
                        <artifactId>feature-plugins</artifactId>
                        <version>3.0.5</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <ramlFile>${project.basedir}\src\main\resources\api.raml
                    </ramlFile>
                    <resourcePackage>com.project.company.resources</resourcePackage>
                    <modelPackage>com.project.company.model</modelPackage>
                    <supportPackage>com.project.company.support</supportPackage>
                    <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                    <jsonMapper>jackson2</jsonMapper>
                    <generateTypesWith>jsr303</generateTypesWith>
                    <jsonMapperConfiguration>
                        <includeAdditionalProperties>false</includeAdditionalProperties>
                    </jsonMapperConfiguration>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions