Multipart/form-data request body example
Originally posted by user Thien to the Stoplight Community on 11/01/2023 at 02:44 ET. Hi everyone, I have an API that is accepting a body of content type multipart/form-data. In the request body, I am sending 2 parts, 1 part contains raw json, the other part contains a binary file. curl --location --request POST 'https://my-site.com/documents' \ --header 'Authorization: Bearer xyz' \ --form 'files=@"document.pdf"' \ --form 'metadata="{ "data": "data" }"' I am trying to add a json example, so that it autofill in the example cUrl. But the json example that I added does not show in the documentation. With the same OpenAPI yaml file, I can get Swagger to show the json example. I tried googling and search here on discord but could not find any related information on how to make the json examples shown. Does Stoplight not yet support showing json examples for multipart/form-data request body? Or am I doing something wrong? Thanks a bunch.Solved699Views0likes1CommentMultiple files upload in Multipart request body
Originally posted by user Thien to the Stoplight Community on 06/19/2023 at 04:16 ET. Hello everyone, I have an API that receives a multipart/form-data request body. In the multipart, the client can input multiple files. In the OpenAPI yaml file, I described the request body of the API like this to show that the client can upload multiple files in the multipart body: requestBody: content: multipart/form-data: schema: type: object properties: files: type: array items: type: string format: binary But when I come to Stoplight, it only shows an input to enter text (image 1). With the same OpenAPI yaml file, SwaggerUI show the option to upload multiple files (image 2). Only when I change the OpenAPI yaml file to only allow upload 1 file, then Stoplight shows the option to upload single file (image 3). requestBody: content: multipart/form-data: schema: type: object properties: files: type: string format: binary Is there any other configurations that I am missing that tells Stoplight to display an option to upload multiple files? I tried searching through discord and on the internet but was not able to find additional information. Thank you.Solved300Views0likes1CommentSample project
Originally posted by user jerlandsson to the Stoplight Community on 07/11/2023 at 04:30 ET. Is there a stoplight sample project with all the bells and whistles that I can use to show my colleagues to inspire them to get on board with Stoplight? The studio is great, but not every nerd like a GUI to write these things. However, in combination with the mocking and the docs section it becomes really clear what a great product you have built. I just need some of them to be able to click around and see it for themselves rather than watching a sales pitch video on youtube, cause that won't fly with the more "what we already have works just fine" crowd.Solved299Views0likes1CommentConditionally Required Parameters
Originally posted by user brad.samuels to the Stoplight Community on 10/24/2023 at 18:34 ET. Within a request Body, it is possible to add "OneOf" and "AnyOf" cases; Is there any way to do the same thing for query parameters in the request? If there is another solution to my use-case, I'm happy to use that instead. Use-case: I am currently needing specific query parameters to be considered required based on the input of another query parameter (eg. if searchType equals name, then name is considered required).Solved199Views0likes1CommentUpdating OpenAPI file assigns new Stoplight stable IDs
Originally posted by user markg to the Stoplight Community on 04/20/2023 at 18:14 ET. Hi there, I uploaded an OpenAPI spec generated by a third-party tool to get started. I then copied the Stoplight stable IDs that Stoplight generated into our OpenAPI spec, so that our resources and models would stay at the same URLs. But when I uploaded it again (which I couldn't find a way to do other than like, copying the OpenAPI spec text into the Code tab in the Studio), it assigns totally new Stoplight IDs to them, overwriting the ones that were assigned before. Is there a way to update our OpenAPI file without these stable IDs getting overwritten? Thank you!Solved99Views0likes2Commentslinting yaml files with multiple documents in the yaml file
Originally posted by user ItsGameOvrMan to the Stoplight Community on 01/25/2023 at 14:32 ET. Trying to run against a yaml file: apiVersion: backstage.io/v1alpha1 kind: Domain metadata: name: demo-name title: A demo description: The Demo for spectral spec: owner: group:org-group --- apiVersion: backstage.io/v1alpha1 kind: Domain metadata: name: demo-name-2 title: A demo description: The Demo for spectral spec: owner: group:org-group Here is the ruleset: rules: metadata-name-kebab-case: description: Metadata name attribute should be kebab-case. message: "{{property}} should be kebab-case (lower-case and separated with hyphens)" severity: error given: $.metadata.name then: function: pattern functionOptions: match: "^(\/|[a-z0-9-.]+|{[a-zA-Z0-9_]+})+$" Getting an error: 1:1 error parser Expected a single document in the stream, but found more How can I have it run/apply to multiple documents within a yaml file or has this feature been removed?99Views0likes0CommentsCan I host generated stoplight frontend in my own servers?
Originally posted by user mukhamux to the Stoplight Community on 11/29/2022 at 09:40 ET. Hi, I generated beautiful API docs in stoplight service and want host it on my own servers. Are there any ways to do that? Can't find nothing about self-hosted models on the site.Solved99Views0likes1CommentReference parameters/components from another OpenAPI json (same project)
Originally posted by user Luca P. to the Stoplight Community on 05/18/2023 at 13:18 ET. I have multiple OpenAPI JSON files in the same project, let's call them A.json and B.json. In A there are a few parameters defined in #/components/parameters. I've just found out, while editing in "Form" mode the parameters of an API in B, that the picker allows to select A's parameters (selecting "This project" in the dropdown), with an extended reference as ./A.json#/components/parameters/my_parameter. First question: is this an intended behavior? Second: I tried the same trick with models and responses, but both pickers don't show any definitions from A ("This project" is selected). But, switching from "Form" to "Code" mode, and entering manually the exact $ref path (e.g. ./A.json#/components/schemas/my_model), everything seems to work without issues. In general, are cross-file references allowed?Solved82Views0likes3Comments