Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main-lts] Fix path generate #894

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface {classname} {
@io.quarkiverse.openapi.generator.markers.OperationMarker(name="{defaultSecurityScheme}", openApiSpecId="{quarkus-generator.openApiSpecId}", operationId="{op.operationId}", method="{op.httpMethod}", path="{contextPath}{commonPath}{op.path.orEmpty}")
{/if}
@jakarta.ws.rs.{op.httpMethod}
{#if op.subresourceOperation}
{#if op.subresourceOperation || op.path eq '/'}
@jakarta.ws.rs.Path("{op.path}")
{/if}
{#if op.hasConsumes}
Expand Down
91 changes: 91 additions & 0 deletions client/integration-tests/path/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?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>
<parent>
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator-integration-tests</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>quarkus-openapi-generator-it-path</artifactId>
<name>Quarkus - Openapi Generator - Integration Tests - Client - path</name>
<description>Test from path</description>

<dependencies>
<dependency>
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native-image</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>${native.surefire.skip}</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
openapi: 3.0.3
info:
title: code-with-quarkus API
version: 1.0.0-SNAPSHOT
servers:
- url: http://localhost:8080
description: Auto generated value
- url: http://0.0.0.0:8080
description: Auto generated value
paths:
/users/:
get:
tags:
- User Resource
description: Find All
operationId: UserResource_findAll
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
post:
tags:
- User Resource
description: Add
operationId: UserResource_add
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/User"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
/users/{id}:
get:
tags:
- User Resource
description: Find
operationId: UserResource_find
parameters:
- name: id
in: path
required: true
schema:
format: int32
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
put:
tags:
- User Resource
description: Update
operationId: UserResource_update
parameters:
- name: id
in: path
required: true
schema:
format: int32
type: integer
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/User"
responses:
"204":
description: No Content
delete:
tags:
- User Resource
description: Delete
operationId: UserResource_delete
parameters:
- name: id
in: path
required: true
schema:
format: int32
type: integer
responses:
"204":
description: No Content
components:
schemas:
User:
type: object
properties:
id:
format: int32
type: integer
name:
type: string
108 changes: 108 additions & 0 deletions client/integration-tests/path/src/main/openapi/openapi-path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
openapi: 3.0.3
info:
title: code-with-quarkus API
version: 1.0.0-SNAPSHOT
servers:
- url: http://localhost:8080
description: Auto generated value
- url: http://0.0.0.0:8080
description: Auto generated value
paths:
/users:
get:
tags:
- User Resource
description: Find All
operationId: UserResource_findAll
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
post:
tags:
- User Resource
description: Add
operationId: UserResource_add
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/User"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
/users/{id}:
get:
tags:
- User Resource
description: Find
operationId: UserResource_find
parameters:
- name: id
in: path
required: true
schema:
format: int32
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
put:
tags:
- User Resource
description: Update
operationId: UserResource_update
parameters:
- name: id
in: path
required: true
schema:
format: int32
type: integer
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/User"
responses:
"204":
description: No Content
delete:
tags:
- User Resource
description: Delete
operationId: UserResource_delete
parameters:
- name: id
in: path
required: true
schema:
format: int32
type: integer
responses:
"204":
description: No Content
components:
schemas:
User:
type: object
properties:
id:
format: int32
type: integer
name:
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quarkus.rest-client.quarkus_simple_openapi_yaml.url=http://localhost:8080
Loading
Loading