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

Models not generated #288

Open
dvasea1 opened this issue Jan 13, 2025 · 1 comment
Open

Models not generated #288

dvasea1 opened this issue Jan 13, 2025 · 1 comment

Comments

@dvasea1
Copy link

dvasea1 commented Jan 13, 2025

Steps to reproduce

swagger_parser:

<...> Set default parameters for all schemes.

output_directory: lib/api
squash_clients: true

Optional. You can pass a list of schemes.

Each schema inherits the parameters described in swagger_parser,

any parameter for any schema can be set manually.

Cannot be used at the same time as schema_path.

schemes:

- schema_url: https://api.example/schema/
  name: pet_service_dart_mappable
  json_serializer: freezed
  client_postfix: Service
  put_clients_in_folder: true
  put_in_folder: true

Expected results

Models generated

Actual results

Models not generating

Your OpenApi snippet

{
"openapi": "3.1.0",
"info": {
"title": "Relationship APP API",
"version": "1.0.0",
"description": "Swagger UI for Relationship APP API"
},
"paths": {
"/auth/token/": {
"post": {
"operationId": "auth_token_create",
"description": "Takes a set of user credentials and returns an access and refresh JSON web\ntoken pair to prove the authentication of those credentials.",
"tags": [
"auth"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
}
},
"description": ""
}
}
}
},
"/auth/token/refresh/": {
"post": {
"operationId": "auth_token_refresh_create",
"description": "Takes a refresh type JSON web token and returns an access type JSON web\ntoken if the refresh token is valid.",
"tags": [
"auth"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
}
},
"description": ""
}
}
}
},
"/schema/": {
"get": {
"operationId": "schema_retrieve",
"description": "OpenApi3 schema for this API. Format can be selected via content negotiation.\n\n- YAML: application/vnd.oai.openapi\n- JSON: application/vnd.oai.openapi+json",
"tags": [
"schema"
],
"security": [
{
"jwtAuth": []
},
{}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {}
}
}
},
"description": ""
}
}
}
},
"/users/": {
"get": {
"operationId": "users_list",
"tags": [
"users"
],
"security": [
{
"jwtAuth": []
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
}
}
},
"description": ""
}
}
},
"post": {
"operationId": "users_create",
"tags": [
"users"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/User"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"required": true
},
"security": [
{
"jwtAuth": []
},
{}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"description": ""
}
}
}
},
"/users/{id}/": {
"get": {
"operationId": "users_retrieve",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "integer"
},
"description": "A unique integer value identifying this user.",
"required": true
}
],
"tags": [
"users"
],
"security": [
{
"jwtAuth": []
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"description": ""
}
}
},
"put": {
"operationId": "users_update",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "integer"
},
"description": "A unique integer value identifying this user.",
"required": true
}
],
"tags": [
"users"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/User"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"required": true
},
"security": [
{
"jwtAuth": []
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"description": ""
}
}
},
"patch": {
"operationId": "users_partial_update",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "integer"
},
"description": "A unique integer value identifying this user.",
"required": true
}
],
"tags": [
"users"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PatchedUser"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/PatchedUser"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PatchedUser"
}
}
}
},
"security": [
{
"jwtAuth": []
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"description": ""
}
}
},
"delete": {
"operationId": "users_destroy",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "integer"
},
"description": "A unique integer value identifying this user.",
"required": true
}
],
"tags": [
"users"
],
"security": [
{
"jwtAuth": []
}
],
"responses": {
"204": {
"description": "No response body"
}
}
}
}
},
"components": {
"schemas": {
"PatchedUser": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"readOnly": true
},
"email": {
"type": "string",
"format": "email",
"title": "Email address",
"maxLength": 254
},
"first_name": {
"type": "string",
"maxLength": 150
},
"last_name": {
"type": "string",
"maxLength": 150
},
"is_active": {
"type": "boolean",
"title": "Active",
"description": "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."
},
"date_joined": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"password": {
"type": "string",
"writeOnly": true
}
}
},
"TokenObtainPair": {
"type": "object",
"properties": {
"email": {
"type": "string",
"writeOnly": true
},
"password": {
"type": "string",
"writeOnly": true
},
"access": {
"type": "string",
"readOnly": true
},
"refresh": {
"type": "string",
"readOnly": true
}
},
"required": [
"access",
"email",
"password",
"refresh"
]
},
"TokenRefresh": {
"type": "object",
"properties": {
"access": {
"type": "string",
"readOnly": true
},
"refresh": {
"type": "string"
}
},
"required": [
"access",
"refresh"
]
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"readOnly": true
},
"email": {
"type": "string",
"format": "email",
"title": "Email address",
"maxLength": 254
},
"first_name": {
"type": "string",
"maxLength": 150
},
"last_name": {
"type": "string",
"maxLength": 150
},
"is_active": {
"type": "boolean",
"title": "Active",
"description": "Designates whether this user should be treated as active. Unselect this instead of deleting accounts."
},
"date_joined": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"password": {
"type": "string",
"writeOnly": true
}
},
"required": [
"date_joined",
"email",
"id",
"password"
]
}
},
"securitySchemes": {
"jwtAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}

Code sample

Code sample
[Paste your code here]

Logs

Logs
[Paste your logs here]

Dart version and used packages versions

Dart version

Dart 3.6.0 • DevTools 2.40.2

Packages version

Flutter 3.27.1 • channel stable

@dvasea1
Copy link
Author

dvasea1 commented Jan 20, 2025

Can anyone help me?

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

No branches or pull requests

1 participant