If you already have a spec, Mockhop can create the endpoints for you.
- Open your project and go to Import/Export.
- On the Import tab, choose Swagger/OpenAPI, or leave Auto-detect on.
- Paste the file's content, or enter its URL and select Fetch from URL.
- Select Import endpoints. Mockhop tells you how many endpoints and responses it created.
Mockhop reads OpenAPI 3 and Swagger 2.0 files, in JSON or YAML. References ($ref) must point inside the same file; references to other files or URLs aren't loaded.
What gets imported
- Endpoints: one endpoint for each path and method in the file.
- Response bodies:
- For
application/jsonresponses, anexampleon the schema becomes the response body. - Without one, Mockhop builds a sample body from the schema's types, using template functions, so it returns new values on every call.
- For
- Not used yet: examples set directly on the media type (
example) and namedexamples. - Path parameters: OpenAPI-style parameters such as
/pets/{petId}are imported as written, but braces are matched as literal text. After the import, change them to Mockhop's syntax:/pets/:petId.
Other formats
The same import accepts:
- Postman collections
- HAR files from your browser's developer tools
- cURL commands
- WSDL files for SOAP services
Auto-detect picks the format from the content.
Fetch from URL: in the cloud version, Mockhop only fetches public addresses. Addresses in private or internal networks are blocked.
New to Mockhop? Start with the quickstart.