-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate schema from openapi spec (#165)
This feature allows users to generate a schema from an openApi spec in the same way that the Verified Permissions console does it. --------- Co-authored-by: Victor Moreno <[email protected]> Co-authored-by: svenjaraether <[email protected]>
- Loading branch information
1 parent
8ac7dc6
commit 9b04d53
Showing
7 changed files
with
391 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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,10 @@ | ||
import { cleanUpApiNameForNamespace } from '../src/cedar-helpers'; | ||
|
||
describe('testing edge cases in cedar helpers', () => { | ||
test('cleanUpApiNameForNamespace tests', () => { | ||
expect(cleanUpApiNameForNamespace('test')).toBe('test'); | ||
expect(cleanUpApiNameForNamespace('bad-name')).toBe('badname'); | ||
expect(cleanUpApiNameForNamespace('---')).toBe('ImportedApi'); | ||
expect(cleanUpApiNameForNamespace('1234backend')).toBe('Api1234backend'); | ||
}); | ||
}); |
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,183 @@ | ||
{ | ||
"swagger" : "2.0", | ||
"info" : { | ||
"version" : "2024-06-18T20:07:31Z", | ||
"title" : "PodcastApp" | ||
}, | ||
"host" : "3se71cmpi4.execute-api.us-west-2.amazonaws.com", | ||
"basePath" : "/prod", | ||
"schemes" : [ "https" ], | ||
"paths" : { | ||
"/fakePatToGetUnitTestCoverage": null, | ||
"/artists" : { | ||
"get" : { | ||
"responses" : { }, | ||
"security" : [ { | ||
"AVPAuthorizer" : [ ] | ||
} ] | ||
}, | ||
"post" : { | ||
"responses" : { } | ||
}, | ||
"delete" : { | ||
"responses" : { } | ||
}, | ||
"options" : { | ||
"consumes" : [ "application/json" ], | ||
"responses" : { | ||
"204" : { | ||
"description" : "204 response", | ||
"headers" : { | ||
"Access-Control-Allow-Origin" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Methods" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Headers" : { | ||
"type" : "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/artists/{artistId}" : { | ||
"delete" : { | ||
"parameters" : [ { | ||
"name" : "artistId", | ||
"in" : "path", | ||
"required" : true, | ||
"type" : "string" | ||
} ], | ||
"responses" : { } | ||
}, | ||
"options" : { | ||
"consumes" : [ "application/json" ], | ||
"parameters" : [ { | ||
"name" : "artistId", | ||
"in" : "path", | ||
"required" : true, | ||
"type" : "string" | ||
} ], | ||
"responses" : { | ||
"204" : { | ||
"description" : "204 response", | ||
"headers" : { | ||
"Access-Control-Allow-Origin" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Methods" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Headers" : { | ||
"type" : "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"patch" : { | ||
"parameters" : [ { | ||
"name" : "artistId", | ||
"in" : "path", | ||
"required" : true, | ||
"type" : "string" | ||
} ], | ||
"responses" : { } | ||
} | ||
}, | ||
"/podcasts" : { | ||
"get" : { | ||
"consumes" : [ "application/json" ], | ||
"produces" : [ "application/json" ], | ||
"responses" : { | ||
"200" : { | ||
"description" : "200 response", | ||
"schema" : { | ||
"$ref" : "#/definitions/Empty" | ||
} | ||
} | ||
}, | ||
"security" : [ { | ||
"AVPAuthorizer" : [ ] | ||
} ] | ||
}, | ||
"post" : { | ||
"responses" : { } | ||
}, | ||
"delete" : { | ||
"responses" : { } | ||
}, | ||
"options" : { | ||
"consumes" : [ "application/json" ], | ||
"responses" : { | ||
"204" : { | ||
"description" : "204 response", | ||
"headers" : { | ||
"Access-Control-Allow-Origin" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Methods" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Headers" : { | ||
"type" : "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/podcasts/{podcastId}" : { | ||
"options" : { | ||
"consumes" : [ "application/json" ], | ||
"parameters" : [ { | ||
"name" : "podcastId", | ||
"in" : "path", | ||
"required" : true, | ||
"type" : "string" | ||
} ], | ||
"responses" : { | ||
"204" : { | ||
"description" : "204 response", | ||
"headers" : { | ||
"Access-Control-Allow-Origin" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Methods" : { | ||
"type" : "string" | ||
}, | ||
"Access-Control-Allow-Headers" : { | ||
"type" : "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"x-amazon-apigateway-any-method" : { | ||
"parameters" : [ { | ||
"name" : "podcastId", | ||
"in" : "path", | ||
"required" : true, | ||
"type" : "string" | ||
} ], | ||
"responses" : { } | ||
} | ||
} | ||
}, | ||
"securityDefinitions" : { | ||
"AVPAuthorizer" : { | ||
"type" : "apiKey", | ||
"name" : "Unused", | ||
"in" : "header", | ||
"x-amazon-apigateway-authtype" : "custom" | ||
} | ||
}, | ||
"definitions" : { | ||
"Empty" : { | ||
"type" : "object", | ||
"title" : "Empty Schema" | ||
} | ||
} | ||
} |
Oops, something went wrong.