Giter VIP home page Giter VIP logo

lob-openapi's People

Contributors

1makedadavis avatar amaan-lob avatar bennykitchell avatar christina-lob avatar hilary avatar jharrell avatar jho44 avatar jlincodes avatar jorgelob avatar juanfriss avatar justineschott avatar kilo59 avatar lbirdeau avatar lobot avatar maelingmurphy avatar mmorgan-lob avatar mmrtnz avatar mwj8410 avatar rogue0137 avatar ronakshahlob avatar senechko avatar shannamurry avatar siddharthpant92 avatar sidneyallen avatar sowmitranalla avatar sudoku-lord avatar thexumaker avatar vmangwani avatar zachwreed avatar zacleids avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lob-openapi's Issues

Update Request: `letters` code samples for POST request & test file with full payload that includes `cards`

In the current docs, the code snippets for the request samples for the letters POST (Create) request do not reflect the new cards property that is now available for inclusion in the payload. The request samples should be updated for all languages shown (curl, node, ruby, python, php, java, elixir).

image

On a related note, the "create a letter, letter with full payload, and certified letter" test in letters_test.js should also be updated to reflect the ability to include the cards property in the full payload portion of the test.

// FULL PAYLOAD LETTER
const date = new Date();
date.setDate(date.getDate() + 1); // adding a day to today's date so clearly within 180 days of today
t.context.to_full = await makeAddress({
description: "Harry - Old Office",
name: "Harry Zhang",
company: "Lob (old)",
address_line1: "210 King St",
address_line2: "# 6100",
address_city: "San Francisco",
address_state: "CA",
address_zip: "94107",
address_country: "US",
phone: "5555555555",
email: "[email protected]",
});
t.context.from_full = await makeAddress({
description: "Harry - New Office",
name: "Harry Zhang",
company: "Lob (new)",
address_line1: "210 King St",
address_city: "San Francisco",
address_state: "CA",
address_zip: "94107",
address_country: "US",
phone: "5555555555",
email: "[email protected]",
});
try {
const create = await prism.setup().then((client) =>
client.post(
resource_endpoint,
{
description: "Demo Letter",
to: t.context.to_full,
from: t.context.from_full,
send_date: date.toISOString(),
color: true,
file: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/us_letter_1pg.pdf",
double_sided: false,
address_placement: "insert_blank_page",
mail_type: "usps_first_class",
extra_service: "registered",
return_envelope: true,
perforated_page: 1,
custom_envelope: null,
merge_variables: { name: "Harry" },
},
{ headers: prism.authHeader }
)
);
t.assert(create.status === 200);
t.assert(!create.data.tracking_number);
t.context.full_id = create.data.id;
} catch (prismError) {
if (Object.keys(prismError).length > 0) {
t.fail(JSON.stringify(prismError, null, 2));
} else {
t.fail(prismError.toString());
}
}

More Detailed Examples for Url Shortener

Context

Looking at the URL shortener docs, it would be nice to get an example payload like we do for something like us_verifications instead of just getting the typing. Small request but would really improve the experience using the docs.
Screenshot 2023-08-07 at 12 52 01 AM

Goal

What is the end goal that a PR linked to this issue would achieve?
Use examples typing for openAPI specs: https://swagger.io/docs/specification/describing-responses/

Alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.


Next Steps or Concerns (optional)

You may realize ahead of time that there are issues spawned from or otherwise related to this issue. Having a separate space for those concerns should help you stay organized and focused. If you have no such concerns, feel free to delete this section.

Semantic error at components.schemas.registered.allOf.0.properties.tracking_events (missing `item` field)

Versions

  • of Node: NA
  • of OpenAPI on branch you pulled from:
    • Are you up to date with main (Y/N)?: Yes
  • of any relevant packages (optional):

Description

According the editor.swagger.io there is a semantic error on line 6362 due to a missing item field that is required for array types.

https://github.com/lob/lob-openapi/blob/main/dist/lob-api-bundled.yml#L6362-L6365

Errors
Semantic error at components.schemas.registered.allOf.0.properties.tracking_events
Schemas with 'type: array', require a sibling 'items: ' field
Jump to line 6362

Steps to Reproduce:

  1. Go to https://editor.swagger.io/
  2. Enter the contents of https://github.com/lob/lob-openapi/blob/main/dist/lob-api-bundled.yml into the editor
  3. Wait for the SwaggerUI to render.

Expected Behavior

The SwaggerUI should render without errors.

Screenshots

Screen Shot 2021-10-18 at 8 51 37 AM
Screen Shot 2021-10-18 at 9 06 45 AM

Additional Context (optional)

Solution seems to be just adding the items field to $ref a tracking_event object.

  • My question is why didn't our API spec linter catch the issue? Is editor.swagger.io wrong/out of date and this is not a semantic error as of openapi: 3.0.3?

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.