-
Notifications
You must be signed in to change notification settings - Fork 159
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
fix, ir-generation: put fully substituted path in url
field of auto-generated EndpointExampleCall
s
#4211
Conversation
@@ -204,8 +204,7 @@ export class ExampleGenerator { | |||
const examples = [ | |||
...endpoint.userSpecifiedExamples.map((userSpecified) => userSpecified.example).filter(isNonNullish) | |||
]; | |||
return { | |||
url: endpoint.path.head, | |||
const exampleWithoutUrl = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core change here
@@ -2570,7 +2570,7 @@ | |||
"autogeneratedExamples": [ | |||
{ | |||
"example": { | |||
"url": "/path/", | |||
"url": "/path/>/>/red/red", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticed this and looking into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec here:
service:
auth: false
base-path: ""
endpoints:
send:
path: /path/{operand}/{maybeOperand}/{operandOrColor}/{maybeOperandOrColor}
method: POST
path-parameters:
operand: root.Operand
maybeOperand: optional<root.Operand>
operandOrColor: root.ColorOrOperand
maybeOperandOrColor: optional<root.ColorOrOperand>
examples:
- path-parameters:
operand: $root.Operand.GreaterThan
maybeOperand: $root.Operand.LessThan
operandOrColor: $root.ColorOrOperand.Red
maybeOperandOrColor: $root.ColorOrOperand.Red
types:
Operand:
docs: |
Tests enum name and value can be
different.
enum:
- value: ">"
name: GREATER_THAN
- value: "="
name: EQUAL_TO
- value: "less_than"
docs: |
The name and value should be similar
are similar for less than.
examples:
- name: GreaterThan
value: ">"
- name: LessThan
value: "less_than"
Color:
enum:
- value: "red"
name: RED
- value: "blue"
name: BLUE
examples:
- name: Red
value: "red"
ColorOrOperand:
discriminated: false
union:
- Color
- Operand
examples:
- name: Red
value: "red"
@@ -526,7 +526,7 @@ | |||
"autogeneratedExamples": [ | |||
{ | |||
"example": { | |||
"url": "", | |||
"url": "/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcb6 this feels wrong ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, fixed!
url
field of auto-generated EndpointExampleCall
surl
field of auto-generated EndpointExampleCall
s
For user-provided example endpoint calls, we were already doing this, code here