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

request : raml routes #119

Open
Tazoeur opened this issue Nov 29, 2018 · 3 comments
Open

request : raml routes #119

Tazoeur opened this issue Nov 29, 2018 · 3 comments

Comments

@Tazoeur
Copy link

Tazoeur commented Nov 29, 2018

If I understood well, your plugin will take the data structure of the OAS and create entities, routes, migration, FormRequests, controlers ...

but the OAS file itself might contain some route definition. Are those routes managed ? Do you plan to do something with it ?

@arthurkushman
Copy link
Contributor

arthurkushman commented Nov 30, 2018

I had no plans for that, but it can be considered as a good starting point for something bigger. I suppose there will be demand in matching those routes with controllers->methods in oas schemas to let users create their own more customisable routes.
Do u mean this kind of declarations?:

/users:
  (meta-resource-method): on a resource
  get:
    (meta-resource-method): on a method
    responses:
      200:
        body:
          type: User[]
          (meta-data): on a body

@Tazoeur
Copy link
Author

Tazoeur commented Nov 30, 2018

Yes
I got another exemple below.
Those are not "simple" CRUD url, but since there is a definition for those, we could imagine that the routes could already be written.
Of course the provided OpenAPI file may contain more information within the facets options (e.g. the controller where the route will be managed, considering that the displayName could be the action)

I must say that I did not think this through, but IMHO it's a must have feature for a OpenAPI parser & code gen package.

/paper/validate/{id}:
  uriParameters:
    id:
      type: integer
  post:
    displayName: "validate_paper"
    description: "Change the status of a \"waiting\" paper to \"validated\""
    responses:
      200:
        body:
          application/json:
            type: "boolean"
            example: true
      400:
        body:
          application/json:
            type: "Error"
            example:
              value: "{\n  \"status\": 400,\n  \"Message\": \"Generic error\"\n}"
              strict: false
/paper/reject/{id}:
  uriParameters:
    id:
      type: integer
  post:
    displayName: "reject_paper"
    description: "Change the status of a \"waiting\" paper to \"rejected\""
    responses:
      200:
        body:
          application/json:
            type: "boolean"
            example: true
      400:
        body:
          application/json:
            type: "Error"
            example:
              value: "{\n  \"status\": 400,\n  \"Message\": \"Generic error\"\n}"
              strict: false

@arthurkushman
Copy link
Contributor

arthurkushman commented Dec 6, 2018

It is ok for standard routes CRUD, but how do we define routes for bulks and relationships? There must be some flag for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants