-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for escaping special characters in the service type name
- Loading branch information
1 parent
4efe8f2
commit 17caab7
Showing
12 changed files
with
527 additions
and
5 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
7 changes: 7 additions & 0 deletions
7
...sources/generators/service/ballerina/service_type/custom_name_only_special_characters.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,7 @@ | ||
import ballerina/http; | ||
|
||
@http:ServiceConfig { basePath: "/v1" } | ||
type OASServiceType service object { | ||
*http:ServiceContract; | ||
resource function post pets() returns InlineResponse400BadRequest; | ||
}; |
7 changes: 7 additions & 0 deletions
7
.../test/resources/generators/service/ballerina/service_type/custom_name_only_whitespace.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,7 @@ | ||
import ballerina/http; | ||
|
||
@http:ServiceConfig { basePath: "/v1" } | ||
type OASServiceType service object { | ||
*http:ServiceContract; | ||
resource function post pets() returns InlineResponse400BadRequest; | ||
}; |
7 changes: 7 additions & 0 deletions
7
...test/resources/generators/service/ballerina/service_type/custom_name_with_empty_value.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,7 @@ | ||
import ballerina/http; | ||
|
||
@http:ServiceConfig { basePath: "/v1" } | ||
type OASServiceType service object { | ||
*http:ServiceContract; | ||
resource function post pets() returns InlineResponse400BadRequest; | ||
}; |
7 changes: 7 additions & 0 deletions
7
...sources/generators/service/ballerina/service_type/custom_name_with_special_characters.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,7 @@ | ||
import ballerina/http; | ||
|
||
@http:ServiceConfig { basePath: "/v1" } | ||
type CustomServiceObjectTypeName1 service object { | ||
*http:ServiceContract; | ||
resource function post pets() returns InlineResponse400BadRequest; | ||
}; |
7 changes: 7 additions & 0 deletions
7
.../test/resources/generators/service/ballerina/service_type/custom_name_with_whitespace.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,7 @@ | ||
import ballerina/http; | ||
|
||
@http:ServiceConfig { basePath: "/v1" } | ||
type CustomServiceObjectTypeName2 service object { | ||
*http:ServiceContract; | ||
resource function post pets() returns InlineResponse400BadRequest; | ||
}; |
78 changes: 78 additions & 0 deletions
78
...esources/generators/service/swagger/service_type/custom_name_only_special_characters.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,78 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: refComponent | ||
description: refComponent | ||
version: 1.0.0 | ||
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 | ||
paths: | ||
/pets: | ||
post: | ||
summary: Creates a new pets. | ||
responses: | ||
'400': | ||
description: A User object | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
description: The error ID. | ||
errorType: | ||
type: string | ||
description: The error name. | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
Pet: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
PetForm: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string |
78 changes: 78 additions & 0 deletions
78
...c/test/resources/generators/service/swagger/service_type/custom_name_only_whitespace.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,78 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: refComponent | ||
description: refComponent | ||
version: 1.0.0 | ||
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 | ||
paths: | ||
/pets: | ||
post: | ||
summary: Creates a new pets. | ||
responses: | ||
'400': | ||
description: A User object | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
description: The error ID. | ||
errorType: | ||
type: string | ||
description: The error name. | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
Pet: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
PetForm: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string |
78 changes: 78 additions & 0 deletions
78
.../test/resources/generators/service/swagger/service_type/custom_name_with_empty_value.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,78 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: refComponent | ||
description: refComponent | ||
version: 1.0.0 | ||
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 | ||
paths: | ||
/pets: | ||
post: | ||
summary: Creates a new pets. | ||
responses: | ||
'400': | ||
description: A User object | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
description: The error ID. | ||
errorType: | ||
type: string | ||
description: The error name. | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
Pet: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string | ||
PetForm: | ||
type: object | ||
required: | ||
- userName | ||
properties: | ||
userName: | ||
type: string | ||
firstName: | ||
type: string | ||
lastName: | ||
type: string |
Oops, something went wrong.