Contributions
Resolved export create new models when I define bodies with object type schemas
Hi, I was using the resolved export for swagger 2.0 to see what the final definition I get with the domains $ref substitution as I read in the SwaggeHub documentation I assumed that these substitutions always work similar to parameter substitutions that put the code exactly at the $ref position, but I saw that the model definitions are generated in the definitions section and use the local $ref where the domain $ref was . Ok in that point, but I think SwaggerHub documentation "Downloading OpenAPI Definitions" that say "Resolved means external links will resolved, that is, the contents of external files will be included in the resulting definition." isn't enough descriptive, specialy for next behavoir My problem is, that for my surprise, when I describe a body schema (request or response) with object type and its properties, resolved export changes my swagger and creates new models with uncontroled names in definitions section too anduse local $ref where I was my object type schema. And above documentation don't say nothing about it because only mention "external links" I don't like it because I only can control the model name in request body with its parameter name (but I don't like link parameter name and model name) and for response body is a weird composite name. It is a special problem when I want to define my "best practicies" and linter rules over final swagger definition Is my Git push (with resolved option) going to do the same? I suppose yes Is there a standard for that kind of resolved export? Is any roadmap to offer different kind of resolved export? Thanks in advance for the help504Views0likes0CommentsStandarization: Regex custom rule filter expresion to retrieve nodes with a specific tag
Hi, I am trying to write a regex custom rule but I can't retrieve the expected nodes using filter expresion. A code example is this: paths: /inventory: get: tags: - pagination responses: 200: description: search results schema: type: object properties: _prev: type: string _next: type: string Next JsonPath expresion don't work: $.paths.*.get.[?(@.tags contains 'pagination')].responses.200.schema.properties.[?(@._prev && @._next)] $.paths.*.[?(@.get.tags contains 'pagination')].*.responses.200.schema.properties.[?(@._prev && @._next)] $.paths.*.get[?(@.tags contains 'pagination')].responses.200.schema.properties.[?(@._prev && @._next)] (without dot after get) $.paths.*[?(@.get.tags contains 'pagination')].*.responses.200.schema.properties.[?(@._prev && @._next)] (without dot after first *) Simplifying my problem, directly, I cannot retrieve the nodes using the first filter for the tag $.paths.*.get.[?(@.tags contains 'pagination')] $.paths.*.[?(@.get.tags contains 'pagination')] $.paths.*.get[?(@.tags contains 'pagination')] (without dot after get) $.paths.*[?(@.get.tags contains 'pagination')] (without dot after first *) I tried too the most basic example $.paths.*.get.[?(@.tags)] $.paths.*.[?(@.get.tags)] $.paths.*.get[?(@.tags)] (without dot after get) $.paths.*[?(@.get.tags)] (without dot after first *) In all these examples Custom Rule editor show me "Path not matched" But I try it using"Jayway JsonPath Evaluator", that I found referenced in "SmartBear AlertSite - JSONPath Syntax", over exported JSON of the above yaml and all they work Am I doing anything wrong? May anyone give me a example? Thank a lot436Views0likes0CommentsStandarization: Improvement of path-exist custome rule with filter expresions
Hi, I read in SwaggerHub documentation that currently "JSONPath filter expressions[?(...)]are not supported in "path exists" rules, but they are supported in regex-based rules.", but I found too a thread "Standardization: Custom rule which ensures that at least one server url matches a pattern" that there is a request "SWAG-I-333 Custom Rules linter to support path-exists expressions." for improve this funcionality. Is there any news? Thanks384Views0likes0CommentsRe: How do I refer domain responses, parameters and pathitems from a API?
HiMicheál, thanks for your quick response I tried to make what it indicates but the editor shows me error messages in the cases of domain responses, parameters and pathitems, while for the model it works without errors. And, for example, the editor documentation can't show "skipParam" well. But I have seen that despite the errors, the documentation that the API generates (external link) shows me correctly Is there a way to make the editor not show the errors? Or can these errors cause a problem even though the generated documentation is fine? Maybe is a permissions problem (I am organization, API and domain owner)? Thanks again696Views0likes1CommentHow do I refer domain responses, parameters and pathitems from a API?
Hi, I am starting using domains in swaggerHub and I know yet how reference domains definitions (models) works, but I don't know how reference domain responses, parameters and pathitems and I don't find documentation for that cases. I am trying it using the domain example provided from SwaggerHub uncommenting the domain responses, parameters and pathitems examples ### Domains, a place to put your reusable components ### Examples... info: description: This is a sample Domain version: '1.0.0' title: Sample Domain definitions: ErrorModel: required: - code - message properties: code: type: integer format: int32 message: type: string responses: GeneralError: description: General Error schema: $ref: '#/definitions/ErrorModel' parameters: skipParam: name: skip in: query description: number of items to skip type: integer pathitems: EntityOperations: get: description: Returns a pet based on ID summary: Find pet by ID responses: default: $ref: '#/responses/GeneralError' Can anyone give a code example for everyone? Maybe autocompletion don't work for this cases. Any help? Thanks a lot719Views0likes3Comments