Skip to content
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

Implements OpenApiEndpointSource and SwaggerEndpointSource which … #55

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

logi
Copy link
Contributor

@logi logi commented Sep 7, 2018

…generate the list of endpoints found in the API spec parsed by OpenApiHelper and SwaggerHelper respectively.

This depends on networknt/light-4j#282 and the build can be expected to fail until that is merged.

the change allows this sort of configuration:

- source: com.networknt.openapi.OpenApiEndpointSource
  exec:
  - my-openapi-chain

It logs the resolution at startup like so (from my eval project):

folder for validator.yml
12:54:08.311 [main] is.thing.usernotes-1.0.0  INFO  c.n.openapi.OpenApiEndpointSource listEndpoints - Generating paths from OpenApi spec
12:54:08.312 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/users@get
12:54:08.312 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/users@post
12:54:08.312 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/users/{userId}@get
12:54:08.312 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/users/{userId}@put
12:54:08.312 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/users/{userId}@delete
12:54:08.312 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes@get
12:54:08.313 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes@post
12:54:08.313 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes/{noteId}@get
12:54:08.313 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes/{noteId}@put
12:54:08.313 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes/{noteId}@delete
12:54:08.313 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes/{noteId}/sections@get
12:54:08.313 [main] is.thing.usernotes-1.0.0  DEBUG c.n.openapi.OpenApiEndpointSource listEndpoints - /usernotes/v1/notes/{noteId}/sections/{sectionId}@get

…generate the list of endpoints found in the API spec parsed by `OpenApiHelper` and `SwaggerHelper` respectively.
@logi
Copy link
Contributor Author

logi commented Sep 7, 2018

Localy I have a magical Handler implementation which directs those endpoints to the appropriate methods of UsersResource and NotesResource (with various options for resolution) which closes the spec-to-implementation gap but that's a separate change and nowhere near ready.

@stevehu stevehu merged commit 8c6d226 into networknt:develop Sep 11, 2018
@stevehu
Copy link
Contributor

stevehu commented Sep 11, 2018

@logi Thanks a lot for your help.

@logi logi deleted the develop branch September 12, 2018 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants