Skip to content

Replace planner_id property name with id#2691

Merged
mkultraWasHere merged 2 commits into
apache:masterfrom
nikstuckenbrock:feature/update-openapi-operations-spec
Nov 21, 2022
Merged

Replace planner_id property name with id#2691
mkultraWasHere merged 2 commits into
apache:masterfrom
nikstuckenbrock:feature/update-openapi-operations-spec

Conversation

@nikstuckenbrock
Copy link
Copy Markdown

@nikstuckenbrock nikstuckenbrock commented Nov 17, 2022

Description

I've tried calling the /operations POST endpoint and saw the description mentioning the mandatory fields:

Required schema fields are as follows: "name", "adversary.adversary_id", "planner.planner_id", and "source.id"

As you can see in the corresponding schema and when trying out the API the property under the planner object is called ìdand notplanner_id`.

Type of change

OpenAPI documentation change.

How Has This Been Tested?

This doesn't work:

curl -X 'POST' \
  'http://localhost:8888/api/v2/operations' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"name": "MyApiTest", "adversary": {"adversary_id": "5d3e170e-f1b8-49f9-9ee1-c51605552a08"},"planner": {"planner_id": aaa7c857-7a0-4c4a-85f7-4e9f7f30e31a"},"source": {"id": "ed32b9c3-9593-4c33-b0db-e2007315096b"}}'

This works:

curl -X 'POST' \
  'http://localhost:8888/api/v2/operations' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"name": "MyApiTest", "adversary": {"adversary_id": "5d3e170e-f1b8-49f9-9ee1-c51605552a08"},"planner": {"id": aaa7c857-7a0-4c4a-85f7-4e9f7f30e31a"},"source": {"id": "ed32b9c3-9593-4c33-b0db-e2007315096b"}}'

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation

@mkultraWasHere mkultraWasHere self-requested a review November 17, 2022 15:44
@mkultraWasHere mkultraWasHere added good first issue Want to contribute but don't know where to start? Start with one of these! good feature request labels Nov 17, 2022
@mkultraWasHere mkultraWasHere self-requested a review November 21, 2022 16:55
@mkultraWasHere mkultraWasHere merged commit b655677 into apache:master Nov 21, 2022
@mkultraWasHere
Copy link
Copy Markdown
Contributor

@nikstuckenbrock - Good change writeup, and thank you for contribution.

@nikstuckenbrock
Copy link
Copy Markdown
Author

@elegantmoose - Thanks for the feedback.

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

Labels

good first issue Want to contribute but don't know where to start? Start with one of these!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants