Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master]Update spec with the new all of changes #1786

Merged
merged 6 commits into from
Dec 18, 2024
Merged
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
47 changes: 46 additions & 1 deletion docs/ballerina-to-oas/spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,9 @@ oneOf:
</tr>
</table>

> **Note:** If any field in the record type has a `jsondata:Name` annotation, the name specified in the annotation will be used as the schema name.
> **Note:**
> 1. If any field in the record type has a `jsondata:Name` annotation, the name specified in the annotation will be
> used as the schema name.
>
> Ballerina record type:
> ```ballerina
Expand Down Expand Up @@ -1214,6 +1216,49 @@ oneOf:
> type: string
> additionalProperties: false
> ```
> 2. If we have a record defined in a separate package, for example, packageA:
> ```ballerina
> type RecA record {|
> int a = 10;
> string c = "c";
>|};
>
> ```
> and it is included in packageB:
>```ballerina
> type RecB record {|
> *packageA:RecA;
> string b = "b";
>|};
>```
> In the OpenAPI Specification (OAS) mapping for `RecB`, the default value access API cannot retrieve default values
> from another package. To address this, we generate all the fields explicitly for `RecB` to ensure accessibility.
> ```yaml
> RecA:
> type: object
lnash94 marked this conversation as resolved.
Show resolved Hide resolved
> properties:
> a:
> type: integer
> c:
> type: string
> additionalProperties: false
> RecB:
> type: object
> allOf:
> - $ref: '#/components/schemas/RecA'
> - required:
> - b
> type: object
> properties:
> b:
> type: string
> default: b
> a:
> type: integer
> c:
> type: string
> additionalProperties: false
```

### Ballerina constraints mapping to type schema

Expand Down
Loading