134 Commits

Author SHA1 Message Date
William Cheng
c50a775e0c
prepare 6.5.0 release (#14749) 2023-02-19 20:36:23 +08:00
William Cheng
93df0ff444
Prepare 6.4.0 release (#14748)
* prepare 6.4.0 release

* update samples
2023-02-19 18:53:20 +08:00
William Cheng
31a89e35cb
Prepare 6.4.0 (#14582)
* update to 6.4.0 snapshot

* update samples

* update doc
2023-02-01 22:44:40 +08:00
William Cheng
8f2676c5c2
Prepare v6.3.0 release (#14580)
* 6.3.0 release

* fix maven plugin test

* update samples

* update doc

* fix tests in windows
2023-02-01 20:52:29 +08:00
Michael Ramstein
5047273f1e
[elixir] Properly map AnyType (#14497) 2023-01-24 07:48:49 +01:00
tjbdev
82ac92aed6
[elixir] connection.ex typo fix (#14512) 2023-01-24 07:12:32 +01:00
Michael Ramstein
ccbea26390
[elixir] Fixes issue with setting Header parameters (#14511)
* Fixes issue with request not beeing struct of Tesla.Env when setting a header parameter.
2023-01-23 22:03:05 +01:00
Nathan Baulch
9f1fa0e440
Fix another batch of spelling typos (#13915)
* Fix typos

* Remove repeated words

* Minor grammar fixes
2022-11-07 21:30:24 +08:00
Michael Ramstein
d2a9da5061
[Elixir] Fixes issue with maps/dictionary not present in payload (#13874)
* Adds fix to deserialize nullable maps

* Generate Samples
2022-11-03 17:46:24 +08:00
William Cheng
4d03c9272b prepare 6.3.0 snapshot 2022-10-15 15:40:47 +08:00
Austin Ziegler
de745a4c61
Elixir: Improve generated API options docs (#13478)
While working with the Magento 2.4 API definition, there were several
issues found. The easiest to resolve is a documentation naming issue.
(The others will be raised for discussion.)

This is known to be an issue with query parameters, but may not be
limited to *just* query parameters.

In the event that a parameter is a mix of arrays and objects, the
template in the documentation for the API function was expanding out the
parameter name such that `foo[0]` would be turned into
`:foo_left_square_bracket0_right_square_bracket`, but the actual
parameter name was being left as `:foo[0]`, which meant that the
documentation did not reflect the actual parameter.

> Note: there are issues with the way that query parameters are put
> together in this sense, which is going to require substantially more
> work to resolve as well as discussion on how these options should be
> implemented, as what the Magento API requires may not be what is
> expected by a different server, and the nature of the input parameters
> is itself incorrect.
2022-09-26 11:34:44 +02:00
William Cheng
ac7ebf67dd
Prepare 6.2.1 (#13517)
* update to 6.2.1-SNAPSHOT

* update samples

* update doc
2022-09-25 00:10:30 +08:00
William Cheng
24f476a381
prepare 6.2.0 release (#13514)
* set release version to 6.2.0

* update samples

* comment out rust server test in travis
2022-09-24 21:44:42 +08:00
Elton H.Y. Chou
8e66294bfe
[python-experimental] Enhance octet-stream deserialize (#13402)
* [python-experimental] Enhance octet-stream deserialization

When the headers didn't provide the filename, use the url of response to
extract filename.

* [python-experimental] Remove todo comment.

* [python-experimental] Fix test code.

* Update samples

* [python-experimental] Refined the method and the test

+ Early return when the url is empty or `None`.
+ Removed unused f-string prefix.

* [python-experimental] Comapre url is None explicitly.

* Update samples.
2022-09-12 12:04:14 -07:00
Austin Ziegler
194d421d83
Further Elixir Client Improvements (#12775)
* Further Elixir Client Improvements

Resolves #12731 and is the completion of the work that I started with
#12751.

The changes here are extensive and likely resolve an issue that I have
seen with the Ory SDK (ory/sdk#194). I have also been unable to run the
integration suite for Elixir as I am (trying) to run everything in
Docker (`./run-in-docker.sh`) as I *do not* have a suitable Java
development environment set up, and do not do enough Java work to really
justify it.

- Updated the README for Elixir projects. Aside from some improved
  readability of the template by use of link references instead of
  inline links, I have also fixed the examples:

  - The `deps` example should have been putting a version constraint
    related to `appVersion`.

  - The `config` example should have been using `packageName` instead of
    `appName`. This particular issue repeats.

- In all Elixir files:

  - Changed the function `@docs` formatting:

    - changed the ehading level for `Parameters` and `Returns` to h3
      (`###` instead of `##`). This will make somewhat better looking
      documentation that does not over-emphasize these details (which
      are *not* documented in a normal Elixir way, but this is somewhat
      to be expected with a code generator.) It may be desirable, after
      testing, to change this to `h4` instead of `h3`.

    - Put parameter names and most return types in in-line code blocks
      (`` `hello` ``).

    - Put return types, when there are multiple types, in a Markdown
      list.

  - Fixed a lot of the spacing. Most files will be *closer* to Elixir
    standard formatting than they were. Because of the limitations of
    Mustache, it is still recommended that people who generate Elixir
    clients run `mix format` at least once on their codebase.

- `api.mustache`:

  - Removed an awkward function pipeline call. If we specified at least
    Elixir 1.12 (something that I do not recommend as we have recently
    jumped from requiring Elixir 1.6 to Elixir 1.10), there is a better
    way to specify this now with `Kernel.then/2`. In the meantime,
    assigning the constructed request structure to a variable and then
    making a separate pipeline for the request execution and handling
    makes for *much* easier to read generated code.

  - Fixed the extra space issue with `evaluate_response` call tuple
    values; `{{=<% %>=}}` changes the tag types, so this change is
    intentional.

- In `config.exs.mustache`, `runtime.exs.mustache`, `mix.exs.mustache`,
  and `connection.ex.mustache`, use `packageName` instead of `appName`
  for configuration specification. If `packageName` and `appName`
  differed, we would end up with cases like ory/sdk#194.

- `connection.ex.mustache` has been almost entirely rewritten. The
  changes started in order to eliminate a `@doc` compile-time warning,
  but shifted to remove the old way of building Tesla client structs
  with `use Tesla`. It works, but is no longer the recommended way of
  building Tesla clients.

  - The *recommended* way of building a Tesla Client would now be
    `Tesla.client(Connection.middleware(), Connection.adapter())`.

  - Exposed both `Connection.adapter/0` and `Connection.middleware/1`
    for use. `Connection.middleware/1` has special handling for the
    cases where OAuth2 or HTTP Basic Auth are defined in the
    application, but do not currently handle any other auth methods.

- `deserializer.ex.mustache` has mostly been reformatted. There are
  things that I do not like about it (I do not like pipelines with one
  line), and I have expanded one function capture into an anonymous
  function for readability.

- `request_builder.ex.mustache` has been updated with better
  function and parameter descriptions and names. Please note that if
  `request |> method(:delete) |> method(:post)` is supposed to produce
  a `POST` operation, we will need to change from `Map.put_new/3` to
  `Map.put/3`.

  - Reordered `evaluate_response/2` so that it is the function documented,
    and made `decode/2` and `response_mapping/3` private functions. As
    far as I can tell, I have *not* changed the functionality.

* Address issues found in code review

- The example dependency code in the README had dropped the opening
  brace for the tuple. This has been resolved.

- The default formatting of the API pipelines has been adjusted to
  minimize possible changes from `mix format`.

* Update modules/openapi-generator/src/main/resources/elixir/api.mustache

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Update modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Update templates based on review comments

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>
2022-09-12 19:00:58 +08:00
William Cheng
928070c57a
Prepare 6.1.1 SNAPSHOT version (#13399)
* prepare v6.1.1

* update samples

* update doc
2022-09-11 19:08:23 +08:00
William Cheng
43dbb5ff9c
6.1.0 release (#13398) 2022-09-11 17:16:07 +08:00
William Cheng
6cae0fbb78 Merge remote-tracking branch 'origin/6.1.x' 2022-07-04 01:22:51 +08:00
William Cheng
9e412edb64
Prepare 6.0.1 release (#12762)
* update to v6.0.1

* update doc

* update samples
2022-07-03 23:36:46 +08:00
William Cheng
72b4189f76 add back elixir petstore test-related files 2022-07-03 17:34:11 +08:00
Austin Ziegler
18a07eab37
Improved Elixir Code Generation (#12751)
* Bump the minimum version of Elixir supported

The previous minimum version of Elixir is several years EOL.

The current minimum version of Elixir is also EOL, but is the minimum
version required to support some upcoming changes to the config
templates.

* Bump the minimum version fo Tesla

Keep the dependencies up to date

* Add a default .formatter.exs

* Add two Elixir-specific mustache lambdas

- The `atom` lambda results in the proper quoting of an atom depending
  on the safe contents of the atom text, per the Elixir language
  specification. That is, `{{#atom}}foo{{/atom}}` will be turned into
  `:foo` and `{{#atom}foo.bar{{/atom}}` will be turned into
  `:"foo.bar"`.

- The `env_var` lambda results in the treatment of the identifier
  provided being capitalized as an environment variable would be.
  `{{#env_var}}apiVersion{{/env_var}}` would become `ENV_VAR`.

* Use modern Elixir configuration

- This includes runtime configuration
- It depends on the `env_var` lambda.

* Fix a Language Server Warning

This change is *optional*, but removes a LS warning that was raised.

* Regenerated openapi_petstore for Elixir

* Add ex_doc as a default dependency

Fixes #12484

* Refine the regular expression for atoms

The original regex incorrectly matched `123Number` (unquoted atoms
cannot begin with numbers) and would incorrectly quote atoms ending in
`?` or `!`. Through testing with `iex`, it also turns out that the atom
`:-` is legal.

The following atoms will now not be quoted that would have been
incorrectly quoted:

- `:-`
- `:declawed?`
- `:neutered!`

The following atoms will be quoted that were incorrectly unquoted:

- `:"123Number"`

* Improve regex (again), remove files not generated

- The previous commit resulted in a number of warnings that were still
  present and so I played with the regular expression. This did not
  solve the problem, but the resulting regular expression is *much*
  better than the previous one, so I'm keeping it.

- The problem was that the configuration (`bin/configs/elixir.yaml`) is
  generated using a 3.0 input spec:

  ```yaml
  inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
  ```

  Which means that there were 16 files committed which were no longer
  being generated. When I tested with the 2.0 input spec:

  ```yaml
  inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
  ```

  The files were generated again. I *believe* that the correct change
  here is to switch back to the 2.0 input spec, as it tests more code
  generation, but I wanted to check in before I did this.

  The following files are deleted:

  - `elixir/lib/openapi_petstore/model/additional_properties_any_type.ex`
  - `elixir/lib/openapi_petstore/model/additional_properties_array.ex`
  - `elixir/lib/openapi_petstore/model/additional_properties_boolean.ex`
  - `elixir/lib/openapi_petstore/model/additional_properties_integer.ex`
  - `elixir/lib/openapi_petstore/model/additional_properties_number.ex`
  - `elixir/lib/openapi_petstore/model/additional_properties_object.ex`
  - `elixir/lib/openapi_petstore/model/additional_properties_string.ex`
  - `elixir/lib/openapi_petstore/model/big_cat.ex`
  - `elixir/lib/openapi_petstore/model/big_cat_all_of.ex`
  - `elixir/lib/openapi_petstore/model/inline_response_default.ex`
  - `elixir/lib/openapi_petstore/model/special_model_name.ex`
  - `elixir/lib/openapi_petstore/model/type_holder_default.ex`
  - `elixir/lib/openapi_petstore/model/type_holder_example.ex`
  - `elixir/lib/openapi_petstore/model/xml_item.ex`
  - `elixir/pom.xml`
  - `elixir/test/pet_test.exs`

  In the interim, I have removed those files from the commit.
2022-07-03 17:31:34 +08:00
William Cheng
5bd94b8fa0 prepare 6.1.x 2022-05-26 12:58:25 +08:00
William Cheng
36a9cf394d
update samples (#12466) 2022-05-26 12:13:59 +08:00
William Cheng
69f79fb789
Prepare 6.0.0 release (#12463)
* prepare 6.0.0 release

* update samples

* update meta codegen
2022-05-26 10:28:01 +08:00
William Cheng
12cdacabbf
[Inline model resolver] better handling of inline responses and bug fixes (#12353)
* better handling of inline response schemas, bug fixes

* update samples

* add new files

* better code format

* remove unused ruby files

* fix java test

* remove unused js spec files

* remove inline_response_default_test.dart

* fix webclient tests

* fix spring tests
2022-05-13 10:17:59 +08:00
Johannes
3e5ec3c6ef
Allow the baseUrl of elixir APIs to be overridden (#12268)
* Allow the baseUrl of elixir APIs to be overridden

* Run generator

* Add missing `:`

* Update modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache

Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>

* Generate sample with new change

Co-authored-by: Joe Eifert <joe@databerg.rocks>
Co-authored-by: Michael Ramstein <633688+mrmstn@users.noreply.github.com>
2022-05-01 15:48:52 +08:00
William Cheng
8330e16d66
Better inline model resolver to handle inline schema in array item (#12104)
* better support of inline schema in array item

* update tests

* update samples

* regenerate samples

* fix allof naming, remove files

* add files

* update samples

* update readme

* fix tests

* update samples

* update samples

* add new files

* update test spec

* add back tests

* remove unused files

* comment out python test

* update js test using own spec

* remove files

* remove unused files

* remove files

* remove unused files

* better handling of allOf with a single type

* comment out go test

* remove test_all_of_with_single_ref_single_ref_type.py

* fix inline resolver, uncomment go test
2022-04-20 10:28:15 +08:00
Peter Leibiger
478ed9b8ed
Add a sample of an enum model array in query params (#12107) 2022-04-12 13:53:51 +08:00
Peter Leibiger
15e9d4ed8c
Add example allOf with single ref (#10948)
* Add example allOf with single ref

* fix dart-dio-next handling of that case

* Refactor without vendor extension

* Regenerate newer samples
2022-04-12 13:52:53 +08:00
William Cheng
2d4a01aa70 Revert "Prepare 6.0.0 beta release (#12039)"
This reverts commit 914b539eea7097ad2b4323d20c8f95144782cb68.
2022-04-04 12:17:12 +08:00
William Cheng
914b539eea
Prepare 6.0.0 beta release (#12039)
* update to 6.0.0-beta

* update samples
2022-04-04 10:29:49 +08:00
William Cheng
df05e6f4bc
Update parser to 2.0.29 (#11388)
* update parser to 2.0.29

* better handling of null in dereferencing

* update parser to 2.0.30

* update core to newer version

* add new files

* rollback to previous stable version

* remove files

* Fixes for python-experimental NullableShape component

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2022-02-21 18:37:52 +08:00
William Cheng
acd747ca6d Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-22 12:13:44 +08:00
Peter Leibiger
a558554961
Add OAS3 allowEmptyValue for query params (#10312)
* add the special case of empty query parameters to the fake API
2021-09-03 16:32:51 +08:00
William Cheng
0357b80f19 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-01 14:16:17 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
agilob
7edddb6531
Add map property in url params (#10154)
* Add map property in request params

* Regenerate samples to include map in url property
2021-08-17 18:31:53 +08:00
William Cheng
b799ca9ee0 Merge remote-tracking branch 'origin/5.3.x' into 6.0.x 2021-07-27 11:52:19 +08:00
William Cheng
56aafe30d9 Merge remote-tracking branch 'origin/master' into 5.3.x 2021-07-27 11:33:35 +08:00
Jon Jensen
bd070308d9
[Java][*] Annotate deprecated operations and schemas (#9478)
Refs #3358

Ensure `deprecated` operations are annotated/documented as such on the
generated methods. Libraries updated:
  * [feign]
  * [google-api-client]
  * [microprofile]
  * [okhttp-gson]
  * [resttemplate]
  * [retrofit]
  * [retrofit/play*]
  * [webclient]
  * [vertx]

Ensure `deprecated` schemas are annotated/documented as such on the
generated classes/fields. Libraries updated:
  * [feign]
  * [google-api-client]
  * [jersey2]
  * [microprofile]
  * [native]
  * [okhttp-gson]
  * [rest-assured]
  * [resteasy]
  * [resttemplate]
  * [retrofit*]
  * [webclient]
  * [vertx]

Also fix two minor bugs to get the java sample tests working:

* Fix an invalid jackson-datatype-threetenbp version number in vertx/pom.mustache
* Fix a bad return type in webclient/api_test.mustache when uniqueItems=true

Since this commit updates petstore-with-fake-endpoints-models-for-testing.yaml,
several other samples were updated, but it's just new files to reflect the
deprecated schemas, so there should be no consequential differences.

Relevant bits of the spec:

* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-operationdeprecated
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-schemadeprecated
2021-07-19 10:27:03 +08:00
Toby Archer
8df43a10c1
[Elixir] Adding :package and :description to mix.exs template (#9945)
* feat: templating elixir's mix.exs :package and :description

* adding updated elixir sample
2021-07-16 11:16:18 +08:00
William Cheng
05e4c3cf64 update samples 2021-07-12 17:15:22 +08:00
William Cheng
35f933b27f Merge remote-tracking branch 'origin/5.3.x' into 6.0.x 2021-07-12 17:11:35 +08:00
William Cheng
39fbf53150 create v5.3.0 2021-07-10 00:12:23 +08:00
William Cheng
02835b35bc
Prepare v5.2.1 (#9922)
* bump verions to 5.2.1-SNAPSHOT

* update samples

* update readme

* fix gradle properties
2021-07-09 22:42:31 +08:00
William Cheng
90f7bcd909
Prepare v5.2.0 release (#9920)
* 5.2.0 release

* update samples

* update meta codegen
2021-07-09 17:06:55 +08:00
Peter Leibiger
f7b93ebdf2
Update fake API to contain sample with binary body (#9610) 2021-05-29 10:26:01 +08:00
William Cheng
47483e60cb update version to 5.2.0-SNAPSHOT, update samples 2021-03-21 00:10:10 +08:00
William Cheng
0dc62e8b79
Prepare v5.1.1 in the master (#9027)
* Prepare v5.1.1 in the master

* move dart dio next to configs/other
2021-03-20 23:05:11 +08:00
William Cheng
e023eaa821
Prepare v5.1.0 release (#9017)
* prepare v5.1.0 release

* update samples (dart-dio-next)
2021-03-20 16:45:05 +08:00