* [typescript-angular] Update api template to use HttpClient#request instead of its http-method-specific wrappers
* update expected output for integration tests
* regenerate samples
* use .yaml instead of .yml
This is recommended by Symfony standards
* save Bundle files also to src path
* add test for generate ping
* add package imports
* fix expected file names
* why is Api/ApiServer.php missing
* output filenames
* use getAbsolutePath for debug purpose
* do not use punctuation as current directory
* refactor: remove todos
* use also .yaml in test to fix it
* add test for setting a different source directory
* use correct const for setting source dir property in tests
* import the AbstractPhpCodegen in test class
* put also Resources to source path
* save docs not to Resources
* update samples and improve src path in autoload.php and composer.json
* update moved samples
* Better control of when to write MetaOapg
* Makes MetaOapg in Schema a type hint rather than assignmnet
* Samples regenerated
* Adds tuple types
* Removes types info
* Adds _types
* Samples regenerated
* Adds missing mixins, samples regenerated
* SchemaTypeChecker removed
* Samples regnerated
* fix(typescript-fetch): Handle cors errors.
If there is a communication error,
e.g. an OPTIONS request returns 404 not found,
then the whole request is cancelled and there is no
response object (it is undefined).
I observed the following error:
TypeError: Cannot read properties of undefined (reading 'status')
Basically response was undefined.
In order to circumvent this issue, we do a check
to make sure response is "truthy", which works
for objects.
With these code changes, it will throw a ResponseError,
which is what you would expect instead of a TypeError.
* regenerate typescript-fetch stuff
* retry code generation
Co-authored-by: Joe Heyming <jheyming@Roblox.com>
* [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.
* 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>
* Adds NotAnyTypeSchema
* Unit test sample regenerated
* Turns parameter tests back on
* Removes unused from_server_types
* Reverts version files
* Samples regerated with fixed type hints
* Further fixed type hints
* Adds json detection for application/json-patch+json
* Adds jsonPatch route and schemas
* Adds test_json_patch
* Unit test sample updated
* Reverts version files
* Adds getters and setters for boolean schema true and false
* Updates CodegenModel
* Updates codegenProperty
* Updates codegenparameter and codegenresponse
* Adds comments describing the new properties
* Updates additionalProperty setting for python-experimental
* Sample regenerated
* Docs updated
* Do not write additionalProperties when they are unset
* Updates criteria for when DictSchema subcalsses are created
* Adds NotAnyTypeSchema when a schema is False
* Updates new kwargs signature
* Updates get_item type hints
* Updates sample, readme updated
* Simplifies method calls
* Adds get_item_oapg, removes unset from get_item and getattr
* Sample regenrated
* Fixes tests
* Raises AttributeError if a property is not required and it is dotname accessed
* Fixes one test
* Fixes 3 tests
* Fixes test
* Fixes two more tests
* Fixes test
* Fixes two tests
* Fixes two tests
* Tests fixed
* Unit test sample regerated, fixed unset addprops required type hint issue
* Migration guide updated
* Samples regenerated
* Replaces all validate methods with public validate ones
* More methods made public with _oapg suffix
* Makes methods private where one can
* Fixes tests
* Fixes typo, maked Disciminable methods public
* Method changed to from_openapi_data_oapg
* Fixes tests for from_openapi_data_oapg
* Tweaks endpoint stub so the endpoint exists for ycharm type hints
* Makes Api methods protected
* Adds binary python type hints, makes get_new_instance_without_conversion_oapg public
* Protects some schema methods
* Protects more schema methods
* Renames as_x, is_x acessors with needed suffix
* Fixes some tests
* Fixes tests, fixes new signature for DateSchema
* Methods removed and made private
* Fixes indentation
* Samples regenerated