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

Config panel for Direct element from a route generated from jbang and OpenAPI is not loading #500

Closed
apupier opened this issue Dec 5, 2023 · 3 comments · Fixed by #514
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@apupier
Copy link
Member

apupier commented Dec 5, 2023

Describe the Bug

Config panel for Direct element from a route generated from jbang and OpenAPI is not loading

the content of the file is:

- rest:
    path: "/v1"
    get:
    - id: "listPets"
      path: "/pets"
      produces: "application/json"
      param:
      - dataType: "integer"
        description: "How many items to return at one time (max 100)"
        name: "limit"
        required: false
        type: "query"
      to: "direct:listPets"
    - id: "showPetById"
      path: "/pets/{petId}"
      produces: "application/json"
      param:
      - dataType: "string"
        description: "The id of the pet to retrieve"
        name: "petId"
        required: true
        type: "path"
      to: "direct:showPetById"
    post:
    - id: "createPets"
      path: "/pets"
      produces: "application/json"
      to: "direct:createPets"
- route:
    from:
      uri: "direct:showPetById"
- route:
    from:
      uri: "direct:listPets"
- route:
    from:
      uri: "direct:createPets"

there is this error in the console log:

react-dom.production.min.js:189 TypeError: t.toJSON is not a function
    at camel-route-resource.ts:55:49
    at Array.map (<anonymous>)
    at eL.toJSON (camel-route-resource.ts:55:26)
    at yo (createNode.js:56:27)
    at To.createNode (Document.js:138:22)
    at new To (Document.js:53:47)
    at EN (public-api.js:96:12)
    at Object.updateSourceCodeFromEntities (entities.ts:60:18)
    at w.useCallback.g [as onChangeModel] (CanvasForm.tsx:44:24)
    at t.<anonymous> (AutoForm.js:32:32)

Steps to Reproduce the Bug or Issue

  1. Generate a Camel route from Jbang, with something like:
    jbang '-Dcamel.jbang.version=4.2.0' camel@apache/camel generate rest --input=/home/apupier/Downloads/petstore.json --output=RestOne.camel.yaml --routes

petstore is coming from https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.json
2. Open the generated route
3. Select the Direct element

Screenshots or Videos

image

Platform

online version

@apupier apupier added the bug Something isn't working label Dec 5, 2023
@igarashitm
Copy link
Contributor

I think it's caused by #54, rest is not yet implemented

@igarashitm
Copy link
Contributor

Also, 3 direct routes are recognized as expected, just one is visible and the others are invisible by default.

@lordrip lordrip moved this from New to Todo in Kanban Board Dec 5, 2023
@lordrip lordrip added this to the 2.0.0 milestone Dec 5, 2023
@apupier apupier moved this from Todo to In Progress in Kanban Board Dec 6, 2023
@apupier apupier self-assigned this Dec 6, 2023
@apupier
Copy link
Member Author

apupier commented Dec 6, 2023

Technical investigation:
The entities variable contains the Rest element but not formatted as a BaseCamelEntity:
image

apupier added a commit to apupier/kaoto-next that referenced this issue Dec 6, 2023
for instance when there is a rest element which is not yet handled, we
store the json string corresponding to it and returning it back

fixes KaotoIO#500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@apupier apupier moved this from In Progress to Todo in Kanban Board Dec 7, 2023
@apupier apupier removed their assignment Dec 7, 2023
lordrip added a commit to lordrip/kaoto that referenced this issue Dec 8, 2023
@lordrip lordrip moved this from Todo to In Review in Kanban Board Dec 8, 2023
@apupier apupier moved this from In Review to Todo in Kanban Board Dec 8, 2023
@apupier apupier moved this from Todo to In Progress in Kanban Board Dec 12, 2023
@apupier apupier self-assigned this Dec 12, 2023
apupier added a commit to apupier/kaoto-next that referenced this issue Dec 12, 2023
for instance when there is a rest element which is not yet handled, we
store the json string corresponding to it and returning it back

fixes KaotoIO#500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
apupier pushed a commit to apupier/kaoto-next that referenced this issue Dec 12, 2023
@apupier apupier moved this from In Progress to Todo in Kanban Board Dec 12, 2023
@apupier apupier removed their assignment Dec 12, 2023
@lordrip lordrip moved this from Todo to In Review in Kanban Board Dec 14, 2023
@apupier apupier moved this from In Review to Todo in Kanban Board Dec 20, 2023
apupier added a commit to apupier/kaoto-next that referenced this issue Dec 20, 2023
for instance when there is a rest element which is not yet handled, we
store the json string corresponding to it and returning it back

fixes KaotoIO#500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
apupier pushed a commit to apupier/kaoto-next that referenced this issue Dec 20, 2023
@apupier apupier moved this from Todo to In Progress in Kanban Board Dec 20, 2023
@apupier apupier self-assigned this Dec 20, 2023
apupier added a commit to apupier/kaoto-next that referenced this issue Dec 20, 2023
can be serialized back

relates to KaotoIO#500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@apupier apupier moved this from In Progress to In Review in Kanban Board Dec 20, 2023
apupier added a commit to apupier/kaoto-next that referenced this issue Dec 20, 2023
for instance when there is a rest element which is not yet handled, we
store the json string corresponding to it and returning it back

fixes KaotoIO#500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
apupier pushed a commit to apupier/kaoto-next that referenced this issue Dec 20, 2023
apupier added a commit to apupier/kaoto-next that referenced this issue Dec 20, 2023
can be serialized back

relates to KaotoIO#500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
igarashitm pushed a commit that referenced this issue Dec 20, 2023
for instance when there is a rest element which is not yet handled, we
store the json string corresponding to it and returning it back

fixes #500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
igarashitm pushed a commit that referenced this issue Dec 20, 2023
can be serialized back

relates to #500

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@github-project-automation github-project-automation bot moved this from In Review to Done in Kanban Board Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants