Skip to content

Commit

Permalink
Merge pull request #9627 from lnash94/u11-update-release-note-2
Browse files Browse the repository at this point in the history
[2201.11.0] Update OpenAPI changes for U11
  • Loading branch information
sm1990 authored Dec 16, 2024
2 parents 0c96420 + a557a77 commit e27159c
Showing 1 changed file with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,56 @@ To view bug fixes, see the [GitHub milestone for Swan Lake Update 11 (2201.11.0)
#### CLI

#### OpenAPI tool
- Introduced the `flatten` sub-command, which flattens the OpenAPI contract file by moving all the inline schemas to the components section. The output is a modified OpenAPI contract.

```
$ bal openapi flatten <openapi.yaml>
```
- Introduced the `sanitize` sub-command, which sanitizes the OpenAPI contract file according to Ballerina's best naming practices. The Ballerina name extensions are added to the schemas which can not be modified directly. The output is a modified OpenAPI contract.

```
$ bal openpai sanitize <openapi.yaml>
```
- Add code generation support with the new Ballerina name extensions. These extensions are mapped as relevant annotations in the generated types, parameters and record fields.

For example,
```yaml
...
paths:
/albums:
get:
tags:
- albums
operationId: getAlbums
parameters:
- name: _artists_
in: query
schema:
type: array
items:
type: string
default: []
x-ballerina-name: artists --->// Ballerina name extension
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Album"
```
Generated Ballerina service type code,
```ballerina
...
resource function get albums(@http:Query {name: "_artists_"} string[] artists = []) returns Album[];
...
```
This code generation support is available for client, service implementation, and service type code generation.


- Added support for relaxed data binding on the client side payload. This enables, `nil` values are treated as optional, and absent fields are handled as `nilable` types.

### Improvements

Expand All @@ -73,7 +123,7 @@ To view bug fixes, see the [GitHub milestone for Swan Lake Update 11 (2201.11.0)
To view bug fixes, see the GitHub milestone for Swan Lake Update 11 (2201.11.0) of the repositories below.

- [Language server](https://github.com/ballerina-platform/ballerina-lang/issues?q=is%3Aissue+label%3ATeam%2FLanguageServer+milestone%3A2201.11.0+is%3Aclosed+label%3AType%2FBug+)
- [OpenAPI](https://github.com/ballerina-platform/openapi-tools/issues?q=is%3Aissue+label%3AType%2FBug+milestone%3A%22Swan+Lake+2201.11.0%22+is%3Aclosed)
- [OpenAPI](https://github.com/ballerina-platform/ballerina-library/issues?q=milestone%3A2201.11.0+is%3Aclosed+label%3Amodule%2Fopenapi-tools+label%3AType%2FBug)

## Ballerina packages updates

Expand Down

0 comments on commit e27159c

Please sign in to comment.