Hi. I have a question related to API documentation in Postman. As you know, Postman generates code snippets for the API requests in various programming languages. I’m trying to edit these code snippets like in the image below. Unfortunately, I can’t save these changes to the documentation. Is it actually possible to do that?
From what I’ve seen you can’t change the generated code snippets. I know, It’s really stupid.
If you want to show some custom example code, you should just put it in the documentation itself.
Hey @audendavis
Welcome to the Postman Community
As you have commented against a very old post which shows a 4 year old image of the app - Could you elaborate more on what you mean by not being able to edit the generate snippets?
You can edit the generate code snippets by clicking in the body of the code.
In terms of documentation, you can create response for your requests using examples which show in the documentation.
What’s the use case of having an edited code snippet in the documentation? Who would that be for? Could you not add a code block in the documentation if you needed to explain something specific to the consumers?
I apologize in advance. I’m new to postman and I’m just trying to solve a strange problem my boss brought up.
He dislikes the way postman generated code the C# code using HttpClient for a POST call. He felt that it would be much easier for the user to create an object and parse it into JSON versus just filling in the POST body with a string literal.
All we want to do it to find a way to change the autogenerated code to conform to our programming standards.
Either way, thank you for attention.
- Auden