Giter Club home page Giter Club logo

Comments (4)

tedepstein avatar tedepstein commented on June 20, 2024

I like the idea of a simplifed TaxBlaster model.

from kaizen-openapi-editor.

tfesenko avatar tfesenko commented on June 20, 2024

First, we have to extract the model template from a Java class to a file, so it's easier to commit templates and comment on them.

A simple model with TaxFilingObject and PersonObject, it's almost 100 lines.
We can remove the PersonObject and make it 65 lines long, see models below.

TaxFiling and Person:

---
swagger: "2.0"
info:
  description: "Tax Blaster"
  version: "1.0.0"
  title: "TaxBlaster"
host: "taxblaster.com"
basePath: "/api"
tags:
- name: "TaxFilingObject"
  description: "An individual Tax Filing record, accessed by its ID"
- name: "PersonObject"
  description: "An individual user by ID."
schemes:
- "http"
paths:
  /taxFilings/{id}:
    get:
      tags:
      - "TaxFilingObject"
      description: ""
      operationId: "getTaxFiling"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "filingID of the requested TaxFiling"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/TaxFilingObject"
        404:
          description: ""
    parameters:
    - name: "id"
      in: "path"
      description: "filingID of the requested TaxFiling"
      required: true
      type: "string"
  /people/{id}:
    get:
      tags:
      - "PersonObject"
      responses:
        200:
          description: "Get information about a Person"
          schema:
            $ref: "#/definitions/PersonObject"
    put:
      tags:
      - "PersonObject"
      operationId: "putPersonObject"
      responses:
        200:
          description: "Submit information about a Person"
    parameters:
    - name: "id"
      in: "path"
      description: "taxpayerID of the requested Person"
      required: true
      type: "string"

definitions:
  TaxFilingObject:
    type: "object"
    description: "An individual Tax Filing record, accessed by its ID"
    properties:
      filingID:
        type: "string"
      jurisdiction:
        type: "string"
      year:
        type: "string"
      period:
        type: "integer"
      currency:
        type: "string"
      grossIncome:
        type: "number"
      taxLiability:
        type: "number"
      taxpayer:
        type: "object"

  PersonObject:
    type: "object"
    description: "An individual user by ID."
    properties:
      taxpayerID:
        type: "string"
      lastName:
        type: "string"

TaxFiling only:

---
swagger: "2.0"
info:
  description: "Tax Blaster"
  version: "1.0.0"
  title: "TaxBlaster"
host: "taxblaster.com"
basePath: "/api"
tags:
- name: "TaxFilingObject"
  description: "An individual Tax Filing record, accessed by its ID"
schemes:
- "http"
paths:
  /taxFilings/{id}:
    get:
      tags:
      - "TaxFilingObject"
      description: ""
      operationId: "getTaxFiling"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "filingID of the requested TaxFiling"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/TaxFilingObject"
        404:
          description: ""
    parameters:
    - name: "id"
      in: "path"
      description: "filingID of the requested TaxFiling"
      required: true
      type: "string"

definitions:
  TaxFilingObject:
    type: "object"
    description: "An individual Tax Filing record, accessed by its ID"
    properties:
      filingID:
        type: "string"
      jurisdiction:
        type: "string"
      year:
        type: "string"
      period:
        type: "integer"
      currency:
        type: "string"
      grossIncome:
        type: "number"
      taxLiability:
        type: "number"
      taxpayer:
        type: "object"

from kaizen-openapi-editor.

ghillairet avatar ghillairet commented on June 20, 2024

I have updated the wizard to include the tax filling example.

from kaizen-openapi-editor.

tfesenko avatar tfesenko commented on June 20, 2024

Reassigning my myself.
The short TaxFiling example is used as a default model, it can be viewed and commented on here - https://github.com/ModelSolv/SwagEdit/blob/master/com.reprezen.swagedit/resources/default.yaml

from kaizen-openapi-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.