Skip to content

Commit

Permalink
Merge branch 'master' into reserved-words-2
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-mfg committed Oct 3, 2023
2 parents e7e4ab1 + baf33f0 commit 2c698bb
Show file tree
Hide file tree
Showing 678 changed files with 48,723 additions and 7,936 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/samples-jaxrs-jdk11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Samples JAX-RS (JDK11)

on:
push:
paths:
- samples/server/petstore/jaxrs/jersey3/**
pull_request:
paths:
- samples/server/petstore/jaxrs/jersey3/**
jobs:
build:
name: Build JAX-RS
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# servers
- samples/server/petstore/jaxrs/jersey3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Cache maven dependencies
uses: actions/cache@v3
env:
cache-name: maven-repository
with:
path: |
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Build
working-directory: ${{ matrix.sample }}
run: mvn clean package
2 changes: 1 addition & 1 deletion .github/workflows/samples-python-client-echo-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
paths:
- samples/client/echo_api/python/**
- .github/workflows/samples-python-client-echo-api.yaml

jobs:
build:
name: Test Python client
Expand All @@ -16,6 +15,7 @@ jobs:
sample:
# clients
- samples/client/echo_api/python
- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
python-version:
- "3.7"
- "3.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
sample:
# clients
- samples/client/echo_api/python
- samples/client/echo_api/python-pydantic-v1/
python-version:
- "3.7"
- "3.8"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/samples-python-pydantic-v1-petstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- "3.10"
- "3.11"
sample:
- samples/openapi3/client/petstore/python-aiohttp
- samples/openapi3/client/petstore/python
- samples/openapi3/client/petstore/python-pydantic-v1-aiohttp
- samples/openapi3/client/petstore/python-pydantic-v1
services:
petstore-api:
image: swaggerapi/petstore
Expand Down
9 changes: 9 additions & 0 deletions bin/configs/jaxrs-jersey-jersey3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: jaxrs-jersey
outputDir: samples/server/petstore/jaxrs/jersey3
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS
library: jersey3
additionalProperties:
artifactId: jaxrs-jersey3-petstore-server
hideGenerationTimestamp: "true"
serverPort: "8082"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
generatorName: python
outputDir: samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
templateDir: modules/openapi-generator/src/main/resources/python
additionalProperties:
hideGenerationTimestamp: "true"
disallowAdditionalPropertiesIfNotPresent: "true"
2 changes: 1 addition & 1 deletion bin/generate-samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]}
else
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
sleep 5
#sleep 5
if [ ${#files[@]} -eq 0 ]; then
files=("${root}"/bin/configs/*.yaml)
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Suppose you want to apply snake case naming to mysql schema outputs. Your config
**CLI**

```
openapi-generator -g mysql-schema -o out -i spec.yaml --additional-properties=identifierNamingConvention=snake_case
openapi-generator -g mysql-schema -o out -i spec.yaml --additional-properties=identifierNamingConvention=snake_case,useSingleRequestParameter=true,withInterfaces=true
```

It may seem like a typo but there are two `=` signs in the above example.
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/jaxrs-jersey.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.api|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|library|library template (sub-template)|<dl><dt>**jersey2**</dt><dd>Jersey core 2.x</dd></dl>|jersey2|
|library|library template (sub-template)|<dl><dt>**jersey2**</dt><dd>Jersey core 2.x</dd><dt>**jersey3**</dt><dd>Jersey core 3.x</dd></dl>|jersey2|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.model|
Expand Down
5 changes: 5 additions & 0 deletions docs/generators/python-aiohttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>async</li>
<li>auth_settings</li>
<li>await</li>
<li>base64</li>
<li>body_params</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>date</li>
<li>def</li>
<li>del</li>
<li>elif</li>
Expand All @@ -90,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>exec</li>
<li>false</li>
<li>finally</li>
<li>float</li>
<li>for</li>
<li>form_params</li>
<li>from</li>
Expand All @@ -99,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>import</li>
<li>in</li>
<li>is</li>
<li>json</li>
<li>lambda</li>
<li>local_var_files</li>
<li>none</li>
Expand All @@ -113,6 +117,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>raise</li>
<li>resource_path</li>
<li>return</li>
<li>schema</li>
<li>self</li>
<li>true</li>
<li>try</li>
Expand Down
5 changes: 5 additions & 0 deletions docs/generators/python-blueplanet.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>async</li>
<li>auth_settings</li>
<li>await</li>
<li>base64</li>
<li>body_params</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>date</li>
<li>def</li>
<li>del</li>
<li>elif</li>
Expand All @@ -90,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>exec</li>
<li>false</li>
<li>finally</li>
<li>float</li>
<li>for</li>
<li>form_params</li>
<li>from</li>
Expand All @@ -99,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>import</li>
<li>in</li>
<li>is</li>
<li>json</li>
<li>lambda</li>
<li>local_var_files</li>
<li>none</li>
Expand All @@ -113,6 +117,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>raise</li>
<li>resource_path</li>
<li>return</li>
<li>schema</li>
<li>self</li>
<li>true</li>
<li>try</li>
Expand Down
5 changes: 5 additions & 0 deletions docs/generators/python-fastapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>async</li>
<li>auth_settings</li>
<li>await</li>
<li>base64</li>
<li>body_params</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>date</li>
<li>def</li>
<li>del</li>
<li>elif</li>
Expand All @@ -85,6 +87,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>exec</li>
<li>false</li>
<li>finally</li>
<li>float</li>
<li>for</li>
<li>form_params</li>
<li>from</li>
Expand All @@ -94,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>import</li>
<li>in</li>
<li>is</li>
<li>json</li>
<li>lambda</li>
<li>local_var_files</li>
<li>none</li>
Expand All @@ -108,6 +112,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>raise</li>
<li>resource_path</li>
<li>return</li>
<li>schema</li>
<li>self</li>
<li>true</li>
<li>try</li>
Expand Down
5 changes: 5 additions & 0 deletions docs/generators/python-flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>async</li>
<li>auth_settings</li>
<li>await</li>
<li>base64</li>
<li>body_params</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>date</li>
<li>def</li>
<li>del</li>
<li>elif</li>
Expand All @@ -90,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>exec</li>
<li>false</li>
<li>finally</li>
<li>float</li>
<li>for</li>
<li>form_params</li>
<li>from</li>
Expand All @@ -99,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>import</li>
<li>in</li>
<li>is</li>
<li>json</li>
<li>lambda</li>
<li>local_var_files</li>
<li>none</li>
Expand All @@ -113,6 +117,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>raise</li>
<li>resource_path</li>
<li>return</li>
<li>schema</li>
<li>self</li>
<li>true</li>
<li>try</li>
Expand Down
10 changes: 10 additions & 0 deletions docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## RESERVED WORDS

<ul class="column-ul">
<li>all_params</li>
<li>and</li>
<li>as</li>
<li>assert</li>
<li>async</li>
<li>auth_settings</li>
<li>await</li>
<li>base64</li>
<li>body_params</li>
<li>break</li>
<li>class</li>
<li>continue</li>
Expand All @@ -86,23 +89,30 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>exec</li>
<li>false</li>
<li>finally</li>
<li>float</li>
<li>for</li>
<li>form_params</li>
<li>from</li>
<li>global</li>
<li>header_params</li>
<li>if</li>
<li>import</li>
<li>in</li>
<li>is</li>
<li>json</li>
<li>lambda</li>
<li>local_var_files</li>
<li>none</li>
<li>nonlocal</li>
<li>not</li>
<li>or</li>
<li>pass</li>
<li>path_params</li>
<li>print</li>
<li>property</li>
<li>query_params</li>
<li>raise</li>
<li>resource_path</li>
<li>return</li>
<li>schema</li>
<li>self</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
invoker.goals = -nsu clean generate-sources
# The expected result of the build, possible values are "success" (default) and "failure"
invoker.buildResult = success
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech)
~
~ 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.
-->

<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>org.openapitools.maven.its</groupId>
<artifactId>jaxrs-jersey3</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<inputSpec>https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml</inputSpec>
<generatorName>jaxrs-jersey</generatorName>
<library>jersey3</library>
<dateLibrary>java8</dateLibrary>
<output>${basedir}/out</output>
<templateDirectory>${project.basedir}/templates</templateDirectory>
<configOptions>
</configOptions>
</configuration>
<executions>
<execution>
<id>remote</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 2c698bb

Please sign in to comment.