-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1689 from dilanSachi/fix-empty-header-name
Add default values to record fields
- Loading branch information
Showing
4 changed files
with
115 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...-cli/src/test/resources/generators/schema/ballerina/default_non_required_field_schema.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public type Pet record { | ||
1|2|3 id = 2; | ||
"red"|"green"|"blue" color = "green"; | ||
string name = "Name"; | ||
int age = 1; | ||
string 'type?; | ||
boolean isOld = true; | ||
}; |
83 changes: 83 additions & 0 deletions
83
...i-cli/src/test/resources/generators/schema/swagger/default_non_required_field_schema.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: OpenApi Petstore | ||
license: | ||
name: MIT | ||
servers: | ||
- url: http://petstore.{host}.io/v1 | ||
description: The production API server | ||
variables: | ||
host: | ||
default: openapi | ||
description: this value is assigned by the service provider | ||
- url: https://{subdomain}.swagger.io:{port}/{basePath} | ||
description: The production API server | ||
variables: | ||
subdomain: | ||
default: petstore | ||
description: this value is assigned by the service provider | ||
port: | ||
enum: | ||
- '8443' | ||
- '443' | ||
default: '443' | ||
basePath: | ||
default: v2 | ||
tags: | ||
- name: pets | ||
description: Pets Tag | ||
- name: list | ||
description: List Tag | ||
|
||
paths: | ||
/pets/{petId}: | ||
get: | ||
summary: Info for a specific pet | ||
operationId: showPetById | ||
tags: | ||
- pets | ||
parameters: | ||
- name: petId | ||
in: path | ||
required: true | ||
description: The id of the pet to retrieve | ||
schema: | ||
type: string | ||
responses: | ||
'200': | ||
description: Expected response to a valid request | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Pet" | ||
components: | ||
schemas: | ||
Pet: | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
enum: | ||
- 1 | ||
- 2 | ||
- 3 | ||
default: 2 | ||
color: | ||
type: string | ||
enum: | ||
- red | ||
- green | ||
- blue | ||
default: green | ||
name: | ||
type: string | ||
default: Name | ||
age: | ||
type: integer | ||
default: 1 | ||
type: | ||
type: string | ||
isOld: | ||
type: boolean | ||
default: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters