* Scala-cask improvements:
* fixe for grouped methods which have routes containing dashes.
Previously our OperationGroup work-around would potentially
Create methods like ‘foo-bar’, which isn’t a valid function name
* Fix to not import some.package.Array[Byte] when binary format is specified
* Fix for grouped operations which contain duplicate query parameters
* Fix for binary response fields. This can come up with the following example
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"format" : "binary",
"type" : "string"
}
}
},
"description" : "data"
},
* Fix for enum model classes
Extracted complex logic for ‘asData’ and ‘asModel’ transformations for properties
* Introduced a generic effect F[_] for services
This was done to support composable services
(Service A calls Service B) by using monadic
Effect types (ones which can flatMap)
* Fixed unique union types for responses, asModel and asData fixes for non-model types
* scala-cask: regenerated samples
* Fix for reserved-word properties in the API
* Fix for null imports and reserved-word enum types
* Fixes for api methods with backticked params
* Fix for duplicate (by name) grouped params
* small syntax fix
* logging response type
* Regenerated samples
* String.format fix
* [julia] improve enum support
Improved enum support. Added an override for `postProcessModels` method in julia code generator to do enum post processing. Added an override for `toEnumValue` method in julia code generator to generate enum values correctly based on julia types. Updated templates to use `#enumVars` for generating enum values.
* generated samples
* python-pydantic-v1: Keep trailing commas for tuples when enum has just single member
* Update samples
* Add test for single member enums
* Refactor test name
* [Kotlin Server] Update Ktor to latest version; move config to kts
* Bump gradle version for kotlin server samples
* Replace deprecated gradle API
* Bump gradle to 7.6.4
* Added support for 'additionalProperties:true' to scala-cask generator
additionalProperties means the request can contain arbitrary
additional properties, and so this change adds an 'additionalProperties'
field to request objects which is a json type.
* fixed warning in example scala-cli project
* updated samples
* addressed codegen comments
* Add type information about classes and operation-ids
* Remove unused logger included header
* Bugfix badmatch in delete_resource handler
* Bugfix: respect original indentation of operation_ids
* Bugfix json schema correct refs
* Add a bit more documentation
* Regenerate erlang-server handlers
* Bugfix: exclusiveMinimum/Maximum must be booleans
* Add support for validating and decoding base64 byte strings
* Add support for validating RFC3339 datetime
* Simplify validate function for performance
* Regenerate erlang-server handlers
* Add documentation to server and handlers
* Respond to at least one path-server
* Let url servers override base path
* Handle reading bigger bodies in cowboy
* Improve json error handling
* Regenerate erlang-server handlers
* Rework API module for performance and completion
* Regenerate erlang-server handlers
* Add C++ header for cpp-pistache-server to fix breaking CMake build of generated code.
* Sort includes of system C++ headers for cpp-pistache-server.
* Add samples generated from fixing bug #19683.
* Check references in additionalProperties correctly
Handle references in additionalProperties correctly when determining free-form status
* Update samples
With:
```
sampleObject:
type: object
additionalProperties:
$ref: '#/components/schemas/SampleData'
minProperties: 1
description: Map of Charging data policy decisions.
```
and
```
SampleData:
type: object
...
nullable: true
```
We currently generate: HashMap<String, SampleData>, which doesn't allow
null charging data entries. This MR changes this to be
`HashMap<String, swagger::Nullable<SampleData>>`, which thus will allow null data entries.
We do this by moving null-handling to the Java code - primarily `getTypeDeclaration()`.
Note, to some extent this is wrong. In this MR (and previously) we are treating
`nullable: true` as an extrinsic property (like required), whereas it should be an
intrinsic property (and thus `HashMap<String, SampleData>` is correct, but `SampleData`
absorbs the nullability.
This would be possible with this code:
```
enum ChargingData = {
Null,
Present {
...
}
}
```
Which would remove the usage of https://docs.rs/swagger/2.0.2/swagger/nullable_format/enum.Nullable.html.
I haven't resolved this - and have instead done a more targeted fix.
This, along with some other crude code, creates a scenario where we need to
unpick whether something is null. I've left that, though flagged a TODO to tidy it up at some point.
* [Rust Server] Convert Rust comment to Mustache
The comment about auth types supported by the generator shouldn't be
included in the generated code as it's confusing when the API doesn't
support the same auth types.
As such, we convert it from a Rust comment to a Mustache comment
* Update samples
* Upgrade erlang-server code generation and fix is_authorized crashes
* Introduce structured logging
* Improve general formatting
* Update generated files
* Enable erlang server on CI
* Add echo-server testing to CI
* Require OTP27 explicitly in the generated rebar.config file
* Rework handler and API
With this work, json validation becomes optional, fully implemented in
the `_api` module as it was before, but without being forcibly called by
the `_handler`. It is instead left as optional for the user to take
advantage of the exposed callbacks. Jesse also chooses draft-06 as a
default, but these can be chosen manually by the user too, as long as
jesse implements them.
`_handler` also becomes lighter, it now handles all mime types
transparently by forwarding to a user-given module that must implement
`accept_callback/4` and `provide_callback/4` as described in the
`_logic_handler` callbacks. These will simply be the return values of
cowboy_rest's `content_types_accepted` and `content_types_provided`
respectively, and should simply comply with their defined APIs. They
only get two parameters extending the behaviour, so that the user-given
callback can pattern-match on them: the path prefix of the logic
handler, and the operationID of the call.
* Fix return types for provide_callbacks
* Upgrade jesse to incur no dependencies
The less dependencies the built code requires the better.
* Fix dialyzer errors in the generated code
* Apply stronger dialyzer checks
* fix: typescript-angular -> when model property name is sanitized, use instead original property name within quotes in mustache template
* fix: updated samples
* chore: added comment for hasSanitizedName
* add original tag, add dummy model for test
* update samples
---------
Co-authored-by: Davide Diaconu <davidediak@gmail.com>
* [Rust Server] Add auto-generated CLI tool
* [Rust Server] Test multiple path parameters
* [Rust Server] Test boolean parameters and apostrophes
* [Rust Server] Test operation with two boolean parameters with same first letter
* [Rust Server] Test apostrophes in operation summary
* Update samples
* [Rust Server] Fix build errors with OpenSSL
* Update samples
* Update samples
* [Rust Server] Fix up model generation
- Correctly generate anyOf/oneOf models
- Fix up ToString / FromStr support
- Disable PartialOrd generation for anyOf/oneOf models
- Generate models for inline enums
- Support enums in headers, and vectors of models in headers
* [Rust Server] Add test for anyOf with additional properties
* Update samples
* [Rust Server] Tidy up logging
* [Rust Server] Sort operations so that the ones with fewest params come first
This resolves things correctly per
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#pathsObject
- "When matching URLs, concrete (non-templated) paths would be matched
before their templated counterparts."
* Update samples
* [Rust Server] Fix tabs vs spaces
---------
Co-authored-by: Rob Day <Robert.Day@metaswitch.com>
* [Rust Server] Allow configuration of multipart/form attachment size limit
multipart 0.14+ imposes a 8MB size limit on multipart/form bodies.
This allows that limit to be configured. The default is left as is.
This also improves error messages produced when handling multipart/form bodies.
* Update samples
* Fix server-writing docs for rust-server
Fix broken link in generated README for rust-server.
* Update samples
---------
Co-authored-by: Keith Wansbrough <Keith.Wansbrough@metaswitch.com>
* Suppress Pattern annotation on property of type byte array
Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
* Straggler files from generated samples
* Add new format test to workflows
---------
Signed-off-by: Tim Quinn <tim.quinn@oracle.com>