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

OpenAPI schema missmatch between swagger and generator #1084

Open
sambles opened this issue Jul 12, 2024 · 0 comments
Open

OpenAPI schema missmatch between swagger and generator #1084

sambles opened this issue Jul 12, 2024 · 0 comments

Comments

@sambles
Copy link
Contributor

sambles commented Jul 12, 2024

Issue Description

Issue looks to be from here: encode/django-rest-framework#7427

complex_model_data_files = serializers.PrimaryKeyRelatedField(many=True, read_only=True)

The swagger schema correctly sets this as type integer

    "AnalysisList": {
      "type": "object",
      "properties": {
         ...
        "complex_model_data_files": {                                                                                                                                                                                                                          
          "type": "array",
          "items": {
            "type": "integer"
          },  
            "readOnly": true,
            "uniqueItems": true 
          },  

But the command ./manage.py generate_swagger (from [drf_yasg]) sets this value as strings

    "AnalysisList": {
      "type": "object",
      "properties": {
         ...
        "complex_model_data_files": {                                                                                                                                                                                                                  
           "type": "array",
            "items": {
            "type": "string"
          },  
            "readOnly": true,
            "uniqueItems": true 
          },  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant