Skip to content

Commit

Permalink
Merge pull request #10317 from swagger-api/swos_196
Browse files Browse the repository at this point in the history
test for invalid model name in html2 genetator
  • Loading branch information
gracekarina authored Jun 12, 2020
2 parents 25072dc + 8fa64ec commit 122b5ef
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@

public class GeneratorServiceTest {

@Test(description = "test generator service with html2")
public void testGeneratorService_HTML2() throws IOException {

String path = getTmpFolder().getAbsolutePath();
GenerationRequest request = new GenerationRequest();
request
.codegenVersion(GenerationRequest.CodegenVersion.V3)
.type(GenerationRequest.Type.CLIENT)
.lang("html2")
.spec(loadSpecAsNode("3_0_0/swos196.yaml", true, false))
.options(
new Options()
.outputDir(path)
);

List<File> files = new GeneratorService().generationRequest(request).generate();
Assert.assertFalse(files.isEmpty());
}

@Test(description = "test generator service with java")
public void testGeneratorService_notNullJacksonAnnotationJava_True() throws IOException {
Expand Down
56 changes: 56 additions & 0 deletions modules/swagger-codegen/src/test/resources/3_0_0/swos196.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
openapi: 3.0.0
info:
title: Test in html2
paths:
/access-profile:
post:
operationId: createProfile
summary: Create Profile
description: create Profile Html2
tags:
- Access Profile
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/access-profile"
responses:
'200':
description: success
content:
application/json:
examples:
foo:
value:
{
"id": 0
}
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
access-profile:
type: "object"
properties:
description:
type: "string"
companyId:
type: "string"
status:
type: "boolean"
permissionId:
type: "string"
format: "uuid"
Error:
type: "object"
properties:
code:
type: "integer"
format: "int32"
message:
type: "string"

0 comments on commit 122b5ef

Please sign in to comment.