Skip to content

Commit

Permalink
Update spec with the new all of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lnash94 committed Nov 19, 2024
1 parent 36a06e5 commit ff535a0
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 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,51 @@ 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 = "c";
>|};
>```
> 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
> properties:
> a:
> type: integer
> default: 10
> c:
> type: string
> default: c
> additionalProperties: false
> RecB:
> type: object
> allOf:
> - $ref: '#/components/schemas/RecA'
> - required:
> - b
> type: object
> properties:
> b:
> type: integer
> format: int64
> a:
> type: integer
> c:
> type: string
> additionalProperties: false
```

### Ballerina constraints mapping to type schema

Expand Down

0 comments on commit ff535a0

Please sign in to comment.