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

fix: issue #33 postman request descriptions are strings #34

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented Aug 30, 2024

No description provided.

@frankkilcommins
Copy link
Member

A collection description has a oneOf structure based on the following schema:

   "description":{
      "$schema":"http://json-schema.org/draft-07/schema#",
      "$id":"#/definitions/description",
      "description":"A Description can be a raw text, or be an object, which holds the description along with its format.",
      "oneOf":[
         {
            "type":"object",
            "title":"Description",
            "properties":{
               "content":{
                  "type":"string",
                  "description":"The content of the description goes here, as a raw string."
               },
               "type":{
                  "type":"string",
                  "description":"Holds the mime type of the raw description content. E.g: 'text/markdown' or 'text/html'.\nThe type is used to correctly render the description when generating documentation, or in the Postman app."
               },
               "version":{
                  "description":"Description can have versions associated with it, which should be put in this property."
               }
            }
         },
         {
            "type":"string"
         },
         {
            "type":"null"
         }
      ]
   }

We should deal with the possible options

@YOU54F
Copy link
Member Author

YOU54F commented Aug 30, 2024

I don't believe we are using the parsed value anyway, so we could remove it from attempting to parse completely

Do we have anywhere we can use the description in explore?

If we did, we would want to consider what we can support. Will wherever the field is displayed, does it need truncating? can it support alternate content types? do we want to?

@frankkilcommins
Copy link
Member

It might depend on if we continue using the flat structure or if we allow nesting (preferred) and have multiple request per API "folder".

We could use the API "description" like at:
https://github.com/SmartBear-DevRel/explore-cli/blob/main/src/Explore.Cli/Program.cs#L385

Content will be populated, with string value, if not expliclity set.
@YOU54F YOU54F force-pushed the fix/postman_description branch from dd2b973 to a882228 Compare August 30, 2024 16:29
@YOU54F
Copy link
Member Author

YOU54F commented Aug 30, 2024

We could use the API "description" like at:

good suggestion, implemented

We should deal with the possible options

done, Description.Content, will now contain the value of description if it is a json string, otherwise it will be set to description.content if it exists.

Description.Type / Description.Version may also exist, and Description may be null

The Description.Content value is now used for the description of each uploaded item, and viewable from the UI. I've newline separated the time stamp below

Copy link
Member

@frankkilcommins frankkilcommins left a comment

Choose a reason for hiding this comment

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

LGTM - thanks @YOU54F

@frankkilcommins frankkilcommins merged commit e488338 into main Sep 2, 2024
10 checks passed
@YOU54F YOU54F deleted the fix/postman_description branch September 26, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants