Skip to content

Conversation

bradleat
Copy link

Adding onto #127 we now have type information on the {{responses}} object.

@bradleat
Copy link
Author

Also added optional parameters to typescript definitions

@wcandillon
Copy link
Owner

@bradleat: Is there an example I could look at?

@bradleat
Copy link
Author

@wcandillon apologies. Is the example still needed?

What would you want to see? A source spec and a template that makes use of the new variables?

@@ -55,6 +55,18 @@ function convertType(swaggerType, swagger) {
var property = convertType(propertyType);
property.name = propertyName;
typespec.properties.push(property);
// see if property is required
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change and the one in type.mustache seems to be unrelated to the other change with the response, is my understanding correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. I think you have the correct understanding.

One goal was to give in response type information to the templates.

The other goal was to add the information about optional properties

@wcandillon
Copy link
Owner

@bradleat Can you solve the conflict?

@fantun3s
Copy link

fantun3s commented May 9, 2017

Hi guys,

When will this PR be merged? What is the current status of it?
I really need this feature.

Best Regards

@@ -62,6 +62,24 @@ function convertType(swaggerType, swagger) {
typespec.properties.push(property);
});
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This _forEach should replace the above one, otherwise, it will result in duplicated typescript properties.

@bradleat bradleat closed this Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants