-
Notifications
You must be signed in to change notification settings - Fork 0
Minimal modelling to simply get started #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+189
−1
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9b4cc66
feat: old spec
petrubraha 4a06b73
dependency: linter
petrubraha 60a7d6c
fix: removed useless directory structure
petrubraha b4d435e
fix: namespaces
petrubraha 96abdab
feat: openapi specification generation
petrubraha a120f7a
feat: ignore build files to be commited
petrubraha 34f1d80
removed extra layer of directories
petrubraha 39d621f
feat: mvp only operation
petrubraha a8cfcda
doc: README
petrubraha 12915e7
doc: README
petrubraha 0ba5ca9
feat: typescript codegen
petrubraha 3629d26
fix: namespace
petrubraha 142a2bc
feat: java codegen
petrubraha e2108c2
doc: client generation for java and typescript
petrubraha a49a358
config: gradle for java code generation
petrubraha 521a021
fix: typo
petrubraha c1cbe79
fix: removed pagination trait - no paginated operations for now
petrubraha 101dab7
fix: uuid size constraint
petrubraha 4b0929f
removed unsued property of smithy version
petrubraha 17a2dd0
feat: java code generation with no extra gradle dependency
petrubraha 89aab20
fix: accept uppercase characters in UUID regex pattern
petrubraha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,24 @@ | ||
| # Eclipse | ||
| .classpath | ||
| .project | ||
| .settings/ | ||
|
|
||
| # Intellij | ||
| .idea/ | ||
| *.iml | ||
| *.iws | ||
|
|
||
| # VSCode | ||
| bin/ | ||
|
|
||
| # Mac | ||
| .DS_Store | ||
|
|
||
| # Smithy | ||
| .smithy.lsp.log | ||
|
|
||
| # Ignore Gradle project-specific cache directory | ||
| .gradle | ||
|
|
||
| # Ignore Gradle build output directory | ||
| build/ |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,11 @@ | ||
| # InAndOut-API-Modelling | ||
| Module used to create clients (standard data types and classes) for our services and interfaces | ||
|
|
||
| Complete API model for our system. | ||
|
|
||
| References: | ||
|
|
||
| - https://docs.google.com/document/d/1HnRcB2SaG4f4QodOaaYZT4r4GYhibqBzA8wdl2zpID0/edit?tab=t.h8qwaqvashle | ||
| - https://openapi-converter.com/json-to-yaml | ||
| - https://editor.swagger.io/ | ||
| - https://smithy.io/2.0/languages/java/client/generating-clients.html | ||
| - https://smithy.io/2.0/guides/using-code-generation/generating-a-client.html |
This file contains hidden or 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,42 @@ | ||
| { | ||
| "version": "1.0", | ||
| "outputDirectory": "build/", | ||
| "sources": ["smithy/model/"], | ||
| "maven": { | ||
| "dependencies": [ | ||
| "software.amazon.smithy:smithy-aws-traits:1.68.0", | ||
| "software.amazon.smithy:smithy-openapi:1.68.0", | ||
| "software.amazon.smithy:smithy-linters:1.68.0", | ||
| "software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.45.0", | ||
| "software.amazon.smithy.java:client-codegen:0.0.3", | ||
| "software.amazon.smithy.java:client-core:0.0.3" | ||
| ] | ||
| }, | ||
| "projections": { | ||
| "openapi-spec": { | ||
| "plugins": { | ||
| "openapi": { | ||
| "service": "com.shopping.inandout#InAndOut", | ||
| "protocol": "aws.protocols#restJson1", | ||
| "version": "3.1.0" | ||
| } | ||
| } | ||
| }, | ||
| "java-client": { | ||
| "plugins": { | ||
| "java-client-codegen": { | ||
| "service": "com.shopping.inandout#InAndOut", | ||
| "namespace": "com.shopping.inandout" | ||
| } | ||
| } | ||
| }, | ||
| "typescript-client": { | ||
| "plugins": { | ||
| "typescript-codegen": { | ||
| "package": "@inandout/client", | ||
| "packageVersion": "0.0.1" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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,11 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout | ||
|
|
||
| @pattern("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") | ||
| @length(min: 36, max: 36) | ||
| string UUID | ||
|
|
||
| list UUIDList { | ||
| member: UUID | ||
| } |
This file contains hidden or 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,38 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout | ||
|
|
||
| @error("client") | ||
| @httpError(400) | ||
| structure InvalidInputError { | ||
| @required | ||
| message: String | ||
| } | ||
|
|
||
| @error("client") | ||
| @httpError(404) | ||
| structure ResourceNotFoundError { | ||
| @required | ||
| message: String | ||
| } | ||
|
|
||
| @error("client") | ||
| @httpError(409) | ||
| structure ResourceAlreadyExistsError { | ||
| @required | ||
| message: String | ||
| } | ||
|
|
||
| @error("client") | ||
| @httpError(409) | ||
| structure DeleteRestrictedError { | ||
| @required | ||
| message: String | ||
| } | ||
|
|
||
| @error("server") | ||
| @httpError(500) | ||
| structure InternalServerError { | ||
| @required | ||
| message: String | ||
| } |
This file contains hidden or 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,14 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout | ||
|
|
||
| use com.shopping.inandout.tsp#FindTspSolution | ||
| use aws.protocols#restJson1 | ||
|
|
||
| @restJson1 | ||
| service InAndOut { | ||
| version: "2026-04-01" | ||
| operations: [ | ||
| FindTspSolution | ||
| ] | ||
| } |
This file contains hidden or 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,19 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout.tsp | ||
|
|
||
| use com.shopping.inandout#InternalServerError | ||
| use com.shopping.inandout#InvalidInputError | ||
| use com.shopping.inandout#ResourceNotFoundError | ||
|
|
||
| @http(method: "POST", uri: "/tsp") | ||
| @documentation("Travelling salesman problem solution creation/retrieval operation") | ||
| operation FindTspSolution { | ||
| input: FindTspSolutionInput | ||
| output: FindTspSolutionOutput | ||
| errors: [ | ||
| InvalidInputError | ||
| ResourceNotFoundError | ||
| InternalServerError | ||
| ] | ||
| } |
This file contains hidden or 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,15 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout.tsp | ||
|
|
||
| use com.shopping.inandout#UUIDList | ||
|
|
||
| structure FindTspSolutionInput { | ||
| @required | ||
| standIdList: UUIDList | ||
| } | ||
|
|
||
| structure FindTspSolutionOutput { | ||
| @required | ||
| solutionList: SolutionList | ||
| } | ||
petrubraha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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,16 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout.tsp | ||
|
|
||
| use com.shopping.inandout#UUIDList | ||
|
|
||
| @documentation("Optimal market route") | ||
| structure Solution { | ||
| @required | ||
| @documentation("Ordered location list of the selected articles") | ||
| nodeIdList: UUIDList | ||
| } | ||
|
|
||
| list SolutionList { | ||
| member: Solution | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.