Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Add support for application/x-pem-file MIME type #280

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

robin-nitrokey
Copy link
Contributor

This patch adds support for serializing and deserializing data with the application/x-pem-file MIME type as plain text.

Fixes: #244

Minimal example:

openapi: 3.0.0
info:
  title: Sample API
  version: 0.1.0
servers:
  - url: http://api.example.com/v1
paths:
  /:
    get:
      summary: dummy
      requestBody:
        content:
          application/x-pem-file:
            schema:
              type: string
      responses:
        '200':
          description: dummy
          content:
            application/x-pem-file:
              schema: 
                type: string

Real world example: Nitrokey/nethsm-sdk-py#65

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    mvn clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/python*.
    For Windows users, please run the script in Git BASH.

@robin-nitrokey
Copy link
Contributor Author

robin-nitrokey commented Nov 8, 2023

Not sure why the CI fails. I’ve run the scripts mentioned in the PR template to update the samples but it looks like it did not work.

@spacether
Copy link
Contributor

spacether commented Nov 8, 2023

Thank you for the PR. Can you please run these steps and then commit the changes?

mvn clean package 
./bin/generate-samples.sh

CI is failing because the repo samples have changes when they are regenerated with your fix.

@robin-nitrokey
Copy link
Contributor Author

Oh, I ran the script, added the files but forgot to amend the commit. 🤦 Should be fixed now.

@robin-nitrokey
Copy link
Contributor Author

… and rebased onto master.

This patch adds support for serializing and deserializing data with the
application/x-pem-file MIME type as plain text.

Fixes: openapi-json-schema-tools#244
@robin-nitrokey
Copy link
Contributor Author

… and finally fixed the CI.

@spacether
Copy link
Contributor

Thank you for making those changes. The PR as-is has no tests verifying that it works. If we leave it as-is a future PR could break this functionality without generating a test error signal.
How about

Copy link
Contributor

@spacether spacether left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. I never heard back from you about adding a test so I will add one after merging it.

@spacether spacether merged commit 0c979e0 into openapi-json-schema-tools:master Nov 29, 2023
@robin-nitrokey
Copy link
Contributor Author

@spacether Thank you! I started working on the test but got stuck figuring out the details of the test setup, so I very much appreciate you adding the test.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ][python] Option to treat custom content-types as plain text
2 participants