Skip to content
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
7 changes: 4 additions & 3 deletions .github/workflows/samples-julia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:
working-directory: 'samples'
run: |
currdir=`pwd`
# Using a specific version of OpenAPI.jl helps avoid introducing version inter-dependencies
# and allows breaking changes to be done in either repos independently
# The julia-client/julia-server generators target the OpenAPI.jl 0.2.x series,
# maintained on the release-0.2 branch; OpenAPI.jl main hosts the 1.x rewrite
# with a different API. Testing against release-0.2 covers the latest 0.2.x fixes.
# Using develop mode to install package so that it is easier to modify the package test files
julia -e "using Pkg; Pkg.develop(\"OpenAPI\");"
cd ~/.julia/dev/OpenAPI
git checkout v0.2.0
git checkout release-0.2
cd $currdir
rm -rf ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore
rm -rf ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore
Expand Down
213 changes: 0 additions & 213 deletions docs/generators/julia.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.openapitools.codegen.meta.Stability;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.UUID;

/**
* <p>Mustache templates are located in {@code src/main/resources/julia-client/}.
Expand Down Expand Up @@ -103,12 +105,14 @@ public void processOpts() {
additionalProperties.put("exportModels", exportModels);

if (additionalProperties.containsKey("exportOperations")) {
setExportModels(Boolean.parseBoolean((String) additionalProperties.get("exportOperations")));
setExportOperations(Boolean.parseBoolean((String) additionalProperties.get("exportOperations")));
}
additionalProperties.put("exportOperations", exportModels);
additionalProperties.put("exportOperations", exportOperations);

additionalProperties.put("packageUUID", UUID.nameUUIDFromBytes(("openapi-generator-julia-client-" + packageName).getBytes(StandardCharsets.UTF_8)).toString());
additionalProperties.put("apiDocPath", apiDocPath);
additionalProperties.put("modelDocPath", modelDocPath);
supportingFiles.add(new SupportingFile("Project.mustache", "", "Project.toml"));
supportingFiles.add(new SupportingFile("client.mustache", srcPath, packageName + ".jl"));
supportingFiles.add(new SupportingFile("modelincludes.mustache", srcPath, "modelincludes.jl"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.openapitools.codegen.meta.Stability;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.UUID;

/**
* <p>Mustache templates are located in {@code src/main/resources/julia-server/}.
Expand Down Expand Up @@ -99,8 +101,10 @@ public void processOpts() {
}
additionalProperties.put("exportModels", exportModels);

additionalProperties.put("packageUUID", UUID.nameUUIDFromBytes(("openapi-generator-julia-server-" + packageName).getBytes(StandardCharsets.UTF_8)).toString());
additionalProperties.put("apiDocPath", apiDocPath);
additionalProperties.put("modelDocPath", modelDocPath);
supportingFiles.add(new SupportingFile("Project.mustache", "", "Project.toml"));
supportingFiles.add(new SupportingFile("server.mustache", srcPath, packageName + ".jl"));
supportingFiles.add(new SupportingFile("modelincludes.mustache", srcPath, "modelincludes.jl"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{>partial_header}}
name = "{{packageName}}"
uuid = "{{packageUUID}}"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"

[compat]
OpenAPI = "0.2"
TimeZones = "1"
julia = "1.6"
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}


## Runtime compatibility
This generator targets the 0.2.x series of [OpenAPI.jl](https://github.com/JuliaComputing/OpenAPI.jl), and the generated `Project.toml` pins `OpenAPI = "0.2"` accordingly. OpenAPI.jl 1.x is a pure-Julia generator with a different API (`OpenAPI.client`); code produced by this generator does not run on it. Julia-native users who do not need this generator's features may prefer generating directly with OpenAPI.jl 1.x.

## Installation
Place the Julia files generated under the `src` folder in your Julia project. Include {{packageName}}.jl in the project code.
It would include the module named {{packageName}}.
It would include the module named {{packageName}}. The generated `Project.toml` declares the required dependencies and compatible versions; use it as the project environment or merge its entries into your own project.

Documentation is generated as markdown files under the `docs` folder. You can include them in your project documentation.
Documentation is also embedded in Julia which can be used with a Julia specific documentation generator.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{>partial_header}}
name = "{{packageName}}"
uuid = "{{packageUUID}}"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"

[compat]
HTTP = "1"
OpenAPI = "0.2"
TimeZones = "1"
URIs = "1"
julia = "1.6"
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}


## Runtime compatibility
This generator targets the 0.2.x series of [OpenAPI.jl](https://github.com/JuliaComputing/OpenAPI.jl), and the generated `Project.toml` pins `OpenAPI = "0.2"` accordingly. OpenAPI.jl 1.x is a pure-Julia generator with a different API (`OpenAPI.server`); code produced by this generator does not run on it. Julia-native users who do not need this generator's features may prefer generating directly with OpenAPI.jl 1.x.

## Installation
Place the Julia files generated under the `src` folder in your Julia project. Include {{packageName}}.jl in the project code.
It would include the module named {{packageName}}.
It would include the module named {{packageName}}. The generated `Project.toml` declares the required dependencies and compatible versions; use it as the project environment or merge its entries into your own project.

Implement the server methods as listed below. They are also documented with the {{packageName}} module.
Launch a HTTP server with a router that has all handlers registered. A `register` method is provided in {{packageName}} module for convenience.
Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/julia/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Project.toml
README.md
docs/ApiResponse.md
docs/Category.md
Expand Down
15 changes: 15 additions & 0 deletions samples/client/petstore/julia/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.

name = "OpenAPIGenPetStoreClient"
uuid = "c8baa31a-22f3-3e6f-80b2-d52e48f6776d"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"

[compat]
OpenAPI = "0.2"
TimeZones = "1"
julia = "1.6"
5 changes: 4 additions & 1 deletion samples/client/petstore/julia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- Build package: org.openapitools.codegen.languages.JuliaClientCodegen


## Runtime compatibility
This generator targets the 0.2.x series of [OpenAPI.jl](https://github.com/JuliaComputing/OpenAPI.jl), and the generated `Project.toml` pins `OpenAPI = "0.2"` accordingly. OpenAPI.jl 1.x is a pure-Julia generator with a different API (`OpenAPI.client`); code produced by this generator does not run on it. Julia-native users who do not need this generator's features may prefer generating directly with OpenAPI.jl 1.x.

## Installation
Place the Julia files generated under the `src` folder in your Julia project. Include OpenAPIGenPetStoreClient.jl in the project code.
It would include the module named OpenAPIGenPetStoreClient.
It would include the module named OpenAPIGenPetStoreClient. The generated `Project.toml` declares the required dependencies and compatible versions; use it as the project environment or merge its entries into your own project.

Documentation is generated as markdown files under the `docs` folder. You can include them in your project documentation.
Documentation is also embedded in Julia which can be used with a Julia specific documentation generator.
Expand Down
1 change: 1 addition & 0 deletions samples/server/petstore/julia/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Project.toml
README.md
docs/AnotherModel.md
docs/ApiResponse.md
Expand Down
19 changes: 19 additions & 0 deletions samples/server/petstore/julia/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.

name = "OpenAPIGenPetStoreServer"
uuid = "b5cb3ada-b255-3f07-be90-77727ad78427"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"

[compat]
HTTP = "1"
OpenAPI = "0.2"
TimeZones = "1"
URIs = "1"
julia = "1.6"
Loading
Loading